|
-
Apr 22nd, 2004, 04:27 AM
#1
Thread Starter
Member
RUN Module RUN! [RESOLVED]
Hi all,
I have got a module that I can run from MS Access. At the moment the user is required to go into the VB editor and run the code from there. Obviously this is quite pants, so I was hoping to create a "run button" which the user could just click from the normal Access control panel thing, (tables, queries, macros, modules pane thing...). Doe anyone know how to do this?
Cheers
Last edited by mr_tango; Apr 22nd, 2004 at 05:03 AM.
-
Apr 22nd, 2004, 04:38 AM
#2
Follow these steps & it'll give you an idea of how to do this:
1) Go into modules in your access database, hit the new button, then type this in & save the module as module1 (note that this method has been declared with the Public keyword so as any forms etc. in the database will be able to call upon it):
VB Code:
Public Sub ShowMsg()
MsgBox "Hello World!"
End Sub
2) Go into forms in the same database, click onto the "create form in design view" option - you should now see a blank form ready for designing.
3) Goto the view menu > toolbox & draw a button on the form then click onto the cancel button when the wizard shows. Right click this button & go into properties option at the bottom of this popup menu.
4) Under the event tab, click the OnClick textbox once & an ellipsis (...) button will appear to the right of this. Click this & choose the code builder option.
5) in the code module, make the code look like this, then save all the forms & code & close them down.
VB Code:
Private Sub Command0_Click()
Module1.ShowMsg
End Sub
Start up the form & this'll call out the module's procedure...
-
Apr 22nd, 2004, 05:02 AM
#3
Thread Starter
Member
Top Job! Thanks for the help, it works like a charm.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|