Access 2003
I have a database where all of the tables, forms, reports, and queries reside in one dayabase called abc.mdb. When I open form Test it works. The code in form Test is shown below.
I have another database that is identical to the abc.mdb database, except that the all of the tables are on the back-end, while the forms, reports and queries resides on the front end. The back end is on the network drive and the front end is on the desktop. The network drive can be written to, and there is no VBA code differences on the two Test form.
When I open the Test form on the front end database, it gave me an error message.
Run-time error 3219. Invalid operation.
The error is flagged at the code below.
Set Recordset_Meter_Table = dbs.OpenRecordset("Meter", dbOpenTable)
/////////////////////////////////////
Run-time error 3219. Invalid operation.
/////////////////////////////////////
Private Sub Form_Load()
Dim dbs As Database
Dim Recordset_Meter_Query As DAO.Recordset
Dim Recordset_Meter_Table As DAO.Recordset
Dim Number_Of_Records As Integer
Set dbs = CurrentDb
Set Recordset_Meter_Table = dbs.OpenRecordset("Meter", dbOpenTable)
Set Recordset_Meter_Query = Me.Recordset
Number_Of_Records = Recordset_Meter_Query.RecordCount
If Number_Of_Records = 0 Then
Recordset_Meter_Table.addnew
Recordset_Meter_Table!SONumber = Public_SO_Number
Recordset_Meter_Table!ItemNumber = Public_Item_Number
Recordset_Meter_Table.Update
Me.Requery
End If
End Sub
I have a database where all of the tables, forms, reports, and queries reside in one dayabase called abc.mdb. When I open form Test it works. The code in form Test is shown below.
I have another database that is identical to the abc.mdb database, except that the all of the tables are on the back-end, while the forms, reports and queries resides on the front end. The back end is on the network drive and the front end is on the desktop. The network drive can be written to, and there is no VBA code differences on the two Test form.
When I open the Test form on the front end database, it gave me an error message.
Run-time error 3219. Invalid operation.
The error is flagged at the code below.
Set Recordset_Meter_Table = dbs.OpenRecordset("Meter", dbOpenTable)
/////////////////////////////////////
Run-time error 3219. Invalid operation.
/////////////////////////////////////
Private Sub Form_Load()
Dim dbs As Database
Dim Recordset_Meter_Query As DAO.Recordset
Dim Recordset_Meter_Table As DAO.Recordset
Dim Number_Of_Records As Integer
Set dbs = CurrentDb
Set Recordset_Meter_Table = dbs.OpenRecordset("Meter", dbOpenTable)
Set Recordset_Meter_Query = Me.Recordset
Number_Of_Records = Recordset_Meter_Query.RecordCount
If Number_Of_Records = 0 Then
Recordset_Meter_Table.addnew
Recordset_Meter_Table!SONumber = Public_SO_Number
Recordset_Meter_Table!ItemNumber = Public_Item_Number
Recordset_Meter_Table.Update
Me.Requery
End If
End Sub