Paul Burrows
asked on
How do I execute a module in Access 2007
I used to quite like the previous "macro" functionality
However if I have the attached script in Access 2007 how do I execute it without going to the code and clicking "Run"
However if I have the attached script in Access 2007 how do I execute it without going to the code and clicking "Run"
Function Rebuild()
On Error GoTo Proc_030_Err
DoCmd.SetWarnings False
DoCmd.OpenQuery "100 Clear Temp 01 ARSHIP with keys", acViewNormal, acEdit
DoCmd.OpenQuery "110 ARSHIP with keys", acViewNormal, acEdit
DoCmd.OpenQuery "300 Clear Temp 03 Sales F2007 on", acViewNormal, acEdit
DoCmd.OpenQuery "310 Rebuild Temp 03 Sales F2007 on", acViewNormal, acEdit
MsgBox "Tables Rebuilt", vbInformation, "Finished"
DoCmd.SetWarnings True
Proc_030_Exit:
Exit Function
Proc_030_Err:
MsgBox Error$
Resume Proc_030_Exit
End Function
ASKER
Sorry ... .I don't understand what you mean
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks - I'll give it a go tomorrow when I get to work
Cheers
Cheers
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Real expert's comment should be:
As hnasr suggested "You can use it through code depending on your project." , add.... or ....
;-)
As hnasr suggested "You can use it through code depending on your project." , add.... or ....
;-)
ASKER
I must have missed something.
LSMConsulting - I don't really want to have a form .... I just wish to click the object in the modules section and have the code execute. This is what I would have done in access 2003 and earlier when a macro would run
hnasr - what you suggested did not seem to work. See atached screen as to what I did
8-05-2009-8-31-34-a.m..jpg
LSMConsulting - I don't really want to have a form .... I just wish to click the object in the modules section and have the code execute. This is what I would have done in access 2003 and earlier when a macro would run
hnasr - what you suggested did not seem to work. See atached screen as to what I did
8-05-2009-8-31-34-a.m..jpg
ASKER
I really did miss something in that I discovered you can still create macros in Access 2007 .... which allowed me to run my code as I wanted by running that piece of code
Thanks to you both
Thanks to you both
" I just wish to click the object in the modules section and have the code execute."
Click at End Function line
Press Ctrl+F8
Click at End Function line
Press Ctrl+F8
x = Rebuild()