Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Help

Status
Not open for further replies.

abe6162

Programmer
Sep 7, 2004
24
US
I am pretty new to VBA, please help.

I need to pass this database variable to a function but I get "Type Mismatch" Error.

Below is code:
dim MasterDb as DAO.database
set MasterDb=Opendatabase("C:\test.mdb")

fTest(MasterDb)

function fTest (MasterDb as DAO.database)
end function
 
Hi abe6162,
At first glance,
Your passing a string to the function not a db.

You seem to be missing parts of code?
Maybe you just didn't post?
What's the function suppose to do?
Where is the error occuring in debug mode?

Try removing the 'as DAO.database' in the Function.

Hope this helps...

Carl

AccessGuruCarl
Programmers helping programmers
you can't find a better site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top