call sub in access module from VB (1 Viewer)

rajat

New member
Local time
Yesterday, 19:02
Joined
Jan 10, 2006
Messages
5
hi,
how can i call a sub/function in access from VB.

there is a sub called import in a module modX
i need to call this sub from vb

i tried Call DoCmd.OpenModule(strModName, strSubName) but nothing happens.

Even this didnt work....
Set acObject = CreateObject("Access.application")
acObject.DoCmd.OpenModule(strModName, strSubName)


also if write a function in that module which takes a parameter.....how can i call that function(in access) from VB and pass that parameter.

TIA
 

rajat

New member
Local time
Yesterday, 19:02
Joined
Jan 10, 2006
Messages
5
thanks for quick reply ken....but iam using Visual Basic 6.0

so i need to call this sub/function from vb......thats where i got an issue......code in vb runs (post above) but nothing happens

i actually tryin to export tables/queries/reports/modules from one access database to another programmatically......the function i have written in access module to do the export works.....i need to call that function from VB
thats where the prob is!!!
 

ghudson

Registered User.
Local time
Yesterday, 22:02
Joined
Jun 8, 2002
Messages
6,195
Have you tried setting a reference to your db from within your vb program? That should allow your vb program to run a function from your db. It works with db's so in theory it should work with your vb program.
 

supercharge

Registered User.
Local time
Yesterday, 19:02
Joined
Jun 10, 2005
Messages
215
Why not adding the module to your vb itself, just wonder?
 

Users who are viewing this thread

Top Bottom