I know this code has worked before but now appears to get a compile
error. The code it seems to choke on line 12.
I receive the following message and it highlights the "rst!" statement.
Error received: Microsoft Visual Basic Compile error: Type declaration
character does not match declared data type [(OK) (HELP)]
Private Sub Form_Load()
1 Dim db As Database
2 Dim rst As Recordset
3 Dim strsql As String
4 Dim idnumber As long
5 Dim firstname As String
6 Dim Lastmane As String
7 Set db = CurrentDb
8 strsql = "select [idnumber] from [workers]"
9 Set rst = db.OpenRecordset(strsql)
10 rst.MoveLast
11 rst.MoveFirst
12 idnumber = rst!("idnumber")
13 me.switchboardform = idnumber
14 rst.Close
15 Set rst = Nothing
16 Set db = Nothing
End Sub
Any ideas would be appreciated.
Thanks
Chuck