Guest_imported
New member
- Jan 1, 1970
- 0
Hi,
I'm trying to produce what should be fairly simple code on a MS Access '97 db. I have a table called Members and a form that creates a unique key from a combination of fields. Everytime I run the code, I get a 'type mismatch' error on the line that opens the recordset. The reference to the DAO 3.5 library has been set. Here is the code:
Dim db As Database
Dim rs As Recordset
Dim keycon As String
Dim tbl As TableDef
Set db = CurrentDb
Set rs = db.OpenRecordset("Members"
rs.MoveFirst
Do While Not rs.EOF
keycon = CStr(rs!Memind)
rs!State_Key = rs!Local_Name & keycon
Loop
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
I'm trying to produce what should be fairly simple code on a MS Access '97 db. I have a table called Members and a form that creates a unique key from a combination of fields. Everytime I run the code, I get a 'type mismatch' error on the line that opens the recordset. The reference to the DAO 3.5 library has been set. Here is the code:
Dim db As Database
Dim rs As Recordset
Dim keycon As String
Dim tbl As TableDef
Set db = CurrentDb
Set rs = db.OpenRecordset("Members"
rs.MoveFirst
Do While Not rs.EOF
keycon = CStr(rs!Memind)
rs!State_Key = rs!Local_Name & keycon
Loop
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing