I recently had an Access 97 database converted to ADP. I can't get any of the forms to work. I've updated my references and added DAO to a statement in my code. I still get Error 91, Object variable or with block variable not set. Debugger highlights the "Set rst" statement. Here is my code which is in a module.
Sub UpdateFindInventor(frm As Form, myID As Long)
If myID > 0 Then
frm.Filter = "InventorID = " & myID
frm.FilterOn = True
End If
frm.CbName.Requery
Dim dbs As Database
Set dbs = CurrentDb
Dim rst As DAO.Recordset
Set rst = dbs.OpenRecordset(frm!CbName.RowSource, dbOpenDynaset)
rst.FindFirst "[InventorID] = " & myID
If Not rst.NoMatch Then
frm!CbName = rst!InventorName
Else
frm!CbName = ""
End If
frm!CbName.SetFocus
End Sub
Any help would be appreciated.
Sub UpdateFindInventor(frm As Form, myID As Long)
If myID > 0 Then
frm.Filter = "InventorID = " & myID
frm.FilterOn = True
End If
frm.CbName.Requery
Dim dbs As Database
Set dbs = CurrentDb
Dim rst As DAO.Recordset
Set rst = dbs.OpenRecordset(frm!CbName.RowSource, dbOpenDynaset)
rst.FindFirst "[InventorID] = " & myID
If Not rst.NoMatch Then
frm!CbName = rst!InventorName
Else
frm!CbName = ""
End If
frm!CbName.SetFocus
End Sub
Any help would be appreciated.