call sub in access module from VB

rajat

New member
Local time
Yesterday, 20:37
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
 
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!!!
 
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.
 
Why not adding the module to your vb itself, just wonder?
 

Users who are viewing this thread

Back
Top Bottom