mathprof
asked on
type Mismatch error 13
I need help. Why the type mismatch.
I copied the code from another of my programs and there is no error in the other program. tbl.name is a string.
Dim dbmath As Database
Dim rs As Recordset
Dim ws As Workspace
Set ws = DBEngine.Workspaces(0)
Set dbmath = ws.OpenDatabase(NuevaDB$ + ".mdb")
'next statement gives 'type mismatch' WHY?
Set rs = dbmath.OpenRecordset(tbl.N ame, dbOpenDynaset)
I copied the code from another of my programs and there is no error in the other program. tbl.name is a string.
Dim dbmath As Database
Dim rs As Recordset
Dim ws As Workspace
Set ws = DBEngine.Workspaces(0)
Set dbmath = ws.OpenDatabase(NuevaDB$ + ".mdb")
'next statement gives 'type mismatch' WHY?
Set rs = dbmath.OpenRecordset(tbl.N
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Brilliant.
I changed the dim statement.
And thanks for your speedy response. I never would have figured this one out!
Mathprof
I changed the dim statement.
And thanks for your speedy response. I never would have figured this one out!
Mathprof
Thanks :-)
What DAO Library do you use?
The code works with a reference to Microsoft DAO 3.6 Object Library.
Make sure that tbl.Name contain a valid tablename.