Runtime Error 3219 - Invalid Operation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an Access 2002 database that was converted from Access 97. It appeared
to be operating okay until I split the database (front-end and back-end). Now
I am getting a runtime error message 3219 Invalid Operation. When I run the
debug, it points to a module that was converted from 97 to 2002.

The error pointed to the second set statement:
Set Adult_Information_Input =
ICMS95.OpenRecordset("Adult_Information_Input", dbOpenTable) 'Replaced by
OfficeConverter 8.1.3 on line 29 ' original = Set Adult_Information_Input
= ICMS95.OpenRecordset("Adult_Information_Input", DB_OPEN_TABLE)

Thank you in advance for any help or suggestions.

Below is the module in its entirety:

Private Sub Member_ID_Exit(Cancel As Integer)

' Checks if index key Member ID exists and if yes, displays message box.
' It will not allow user to enter a duplicate key.

Dim ICMS95 As DAO.Database 'Replaced by OfficeConverter 8.1.3 on line 25
' original = Dim ICMS95 As Database
Dim Adult_Information_Input As DAO.Recordset 'Replaced by OfficeConverter
8.1.3 on line 26 ' original = Dim Adult_Information_Input As Recordset


Set ICMS95 = CurrentDb() 'Replaced by OfficeConverter 8.1.3 on line 28 '
original = Set ICMS95 = DBEngine.Workspaces(0).Databases(0)
Set Adult_Information_Input =
ICMS95.OpenRecordset("Adult_Information_Input", dbOpenTable) 'Replaced by
OfficeConverter 8.1.3 on line 29 ' original = Set Adult_Information_Input
= ICMS95.OpenRecordset("Adult_Information_Input", DB_OPEN_TABLE)


Adult_Information_Input.Index = "Member ID"
Adult_Information_Input.Seek "=", Forms![Adult Member MIF]![Member ID]
If Adult_Information_Input.NoMatch Then
Adult_Information_Input.Close
Else
MsgBox "This is a DUPLICATE QUEST number."
End If

End Sub
 
In the Debug Window. First Stop the Module. Go to Tools > References > Make
sure that the Microsoft DAO 3.6 Object Library is added.
 
You can't use dbOpenTable with linked tables. Either drop that parameter, or
replace it with dbOpenDynaset.
 
Doug,

Thank you for the fix - it does in fact work... Now, my question is why does the parameter dbOpenTable (value=1) not work for linked tables while dbOpenDynaset (value=2) work? The location of the tables within MS Access should have no impact on the effective call.

Thanks,

- Ed

Douglas J. Steele said:
You can't use dbOpenTable with linked tables. Either drop that parameter, or
replace it with dbOpenDynaset.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Rena" wrote in message
news:[email protected]...
>I have an Access 2002 database that was converted from Access 97. It
>appeared
> to be operating okay until I split the database (front-end and back-end).
> Now
> I am getting a runtime error message 3219 Invalid Operation. When I run
> the
> debug, it points to a module that was converted from 97 to 2002.
>
> The error pointed to the second set statement:
> Set Adult_Information_Input =
> ICMS95.OpenRecordset("Adult_Information_Input", dbOpenTable) 'Replaced by
> OfficeConverter 8.1.3 on line 29 ' original = Set
> Adult_Information_Input
> = ICMS95.OpenRecordset("Adult_Information_Input", DB_OPEN_TABLE)
>
> Thank you in advance for any help or suggestions.
>
> Below is the module in its entirety:
>
> Private Sub Member_ID_Exit(Cancel As Integer)
>
> ' Checks if index key Member ID exists and if yes, displays message box.
> ' It will not allow user to enter a duplicate key.
>
> Dim ICMS95 As DAO.Database 'Replaced by OfficeConverter 8.1.3 on line 25
> ' original = Dim ICMS95 As Database
> Dim Adult_Information_Input As DAO.Recordset 'Replaced by
> OfficeConverter
> 8.1.3 on line 26 ' original = Dim Adult_Information_Input As Recordset
>
>
> Set ICMS95 = CurrentDb() 'Replaced by OfficeConverter 8.1.3 on line 28 '
> original = Set ICMS95 = DBEngine.Workspaces(0).Databases(0)
> Set Adult_Information_Input =
> ICMS95.OpenRecordset("Adult_Information_Input", dbOpenTable) 'Replaced by
> OfficeConverter 8.1.3 on line 29 ' original = Set
> Adult_Information_Input
> = ICMS95.OpenRecordset("Adult_Information_Input", DB_OPEN_TABLE)
>
>
> Adult_Information_Input.Index = "Member ID"
> Adult_Information_Input.Seek "=", Forms![Adult Member MIF]![Member ID]
> If Adult_Information_Input.NoMatch Then
> Adult_Information_Input.Close
> Else
> MsgBox "This is a DUPLICATE QUEST number."
> End If
>
> End Sub
>
>
 
Back
Top