By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,649 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

type mismatch

P: n/a
ken
If I do this: I get a type mismatch on these ">" lines

Function A_LIST() As String
Dim db As Database
Dim OWNERS As Recordset
Dim LIST As Recordset

Set db = CurrentDb
Set OWNERS = db.OpenRecordset("OWNERSHIP_LIST")
Set LIST = db.OpenRecordset("RPQ")

..
..
..
End Function

If I comment As Recordset the problem goes away. I can't figure out
why?

Thanks

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ken wrote in MESSAGE
<11**********************@g14g2000cwa.googlegroups .com> :
If I do this: I get a type mismatch on these ">" lines

Function A_LIST() As String
Dim db As Database
Dim OWNERS As Recordset
Dim LIST As Recordset

Set db = CurrentDb
Set OWNERS = db.OpenRecordset("OWNERSHIP_LIST")
Set LIST = db.OpenRecordset("RPQ")

.
.
.
End Function

If I comment As Recordset the problem goes away. I can't figure out
why?

Thanks


Try explicit declaration of the DAO objects:

Dim db As DAO.Database
Dim OWNERS As DAO.Recordset
Dim LIST As DAO.Recordset

--
Roy-Vidar

Nov 13 '05 #2

P: n/a
ken wrote:
If I do this: I get a type mismatch on these ">" lines

Function A_LIST() As String
Dim db As Database
Dim OWNERS As Recordset
Dim LIST As Recordset

Set db = CurrentDb
Set OWNERS = db.OpenRecordset("OWNERSHIP_LIST")
Set LIST = db.OpenRecordset("RPQ")


.
.
.
End Function

If I comment As Recordset the problem goes away. I can't figure out
why?

Thanks


You have a reference to ADO that is taking presedence over your DAO
reference, if you must have both references in your application then
prefix the delcared variables thus:

dim OWNERS as DAO.Recordset

--
[OO=00=OO]
Nov 13 '05 #3

P: n/a
ken
ok..that worked. Its just that I have seen other people on this forum
leave out the DAO and I thought I could too...

Nov 13 '05 #4

P: n/a
ken
>You have a reference to ADO that is taking presedence over your DAO
reference, if you must have both references in your application then
prefix the delcared variables thus:

got it!

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.