Calling a module

casey

Registered User.
Local time
Today, 21:16
Joined
Dec 5, 2000
Messages
448
Can someone give me a hint as to how to call a module from VB? I've created the module modUpdateTables, but I can't find out how to run it from my code. I've looked in the help, online and otherwise. Anyone know how that's done?
Thanks, Casey
 
Once the module is in your code, you don't need to call it; its running in the background.

if you have the code, post it.
 
The module is a separate Access object. Like you have tables, queries, forms, macros, I've created a module.

To simplify things, say it does the following:

Private Sub modUpdateTables()
msgbox "hello world!"
End Sub

I have a button that I would like to call this from

Private Sub Command_Click()
'Here I would like to call modUpdateTables to execute it, but nothing seems to work.
'I've tried GoSub modUpdateTables????
'Call modUpdateTables?????
'GoTo modUpdateTables????
'None of these commands work
End Sub

Any ideas? Hope that makes sense.

Any ideas.
 
Last edited:
I thought that I could create this module and then reuse it when I needed to. Maybe I have the wrong idea as to what modules are intended to do.
 
Last edited:
you don't call modules!

you can call functions within the module from form code, with an example such as this:

Call modupdateTables


sportsguy
 
Private Sub modUpdateTables()

You have made it invisible outside itsa own module, use

public Sub modUpdateTables()


Peter
 
casey said:
Can someone give me a hint as to how to call a module from VB? I've created the module modUpdateTables, but I can't find out how to run it from my code. I've looked in the help, online and otherwise. Anyone know how that's done?
Thanks, Casey

Usually you will have your code inside a function or a sub.

A way to call it would be to create a form with a button that calls to the function / sub.

I hope it helps, omasjuan
 

Users who are viewing this thread

Back
Top Bottom