kgcrowther
Registered User.
- Local time
- Today, 22:55
- Joined
- Jun 1, 2001
- Messages
- 52
Some of the most simple things can confuse a beginner. I just want to bring a table in as an object. The following code gives me a type-mismatch error:
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("states")
MsgBox "Record count: " & rs.RecordCount
However, the following code works fine:
Dim rs
Set rs = CurrentDb.OpenRecordset("states")
MsgBox "Record count: " & rs.RecordCount
I seem to be missing something in my fundamental understanding of what the recordset object is. Any insight would be great. (Maybe this is a good thread to have some discussions about a really fundamental programming topic of declaring variable.)
--KGC
Charlottesville, VA, USA
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("states")
MsgBox "Record count: " & rs.RecordCount
However, the following code works fine:
Dim rs
Set rs = CurrentDb.OpenRecordset("states")
MsgBox "Record count: " & rs.RecordCount
I seem to be missing something in my fundamental understanding of what the recordset object is. Any insight would be great. (Maybe this is a good thread to have some discussions about a really fundamental programming topic of declaring variable.)
--KGC
Charlottesville, VA, USA