G
Guest
Using the following code as an example:
Private Sub Button_Click()
Dim rst as Recordset
Dim tdf as TableDef
Set rst = Application.Currentdb.OpenRecordset("tblSuppliers")
MsgBox rst.Name
Set tdf = Application.CurrentDb.TableDefs("tblStaff")
MsgBox tdf.Name
End Sub
When run, a message box appears with the name of the recordset, but then an
error message appears saying "Object invalid or no longer set"
Any suggestions?
Private Sub Button_Click()
Dim rst as Recordset
Dim tdf as TableDef
Set rst = Application.Currentdb.OpenRecordset("tblSuppliers")
MsgBox rst.Name
Set tdf = Application.CurrentDb.TableDefs("tblStaff")
MsgBox tdf.Name
End Sub
When run, a message box appears with the name of the recordset, but then an
error message appears saying "Object invalid or no longer set"
Any suggestions?