Results 1 to 3 of 3

Thread: RUN Module RUN! [RESOLVED]

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2004
    Posts
    58

    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.

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    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:
    1. Public Sub ShowMsg()
    2.     MsgBox "Hello World!"
    3. 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:
    1. Private Sub Command0_Click()
    2.     Module1.ShowMsg
    3. End Sub

    Start up the form & this'll call out the module's procedure...

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2004
    Posts
    58
    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
  •  



Click Here to Expand Forum to Full Width