
Invalid Reference (Error 13 - Type Mismatch)
Hello,
I recently upgraded from Access 97 to 2000. The following code
generates a Type mismatch error. I assumed it was due to an invalid
or missing reference, but I could not find any missing references, and I
have all the VB, DAO, and Object libraries loaded.
Here is the code:
Function fGetCurrentUser() As String
Dim db As Database
Dim rsCU As Recordset
Dim strTable As String
Set db = CurrentDb()
strTable = "tblCurrentUser"
Set rsCU = db.OpenRecordset(strTable) 'Error occurs here
rsCU.MoveFirst
fGetCurrentUser = rsCU!CurrentUser
rsCU.Close
End Function
Thanks,
Joseph Cunningham
Sent via Deja.com http://www.*-*-*.com/
Before you buy.