Runtime Error 3219 - Invalid Operation

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
 
G

Guest

In the Debug Window. First Stop the Module. Go to Tools > References > Make
sure that the Microsoft DAO 3.6 Object Library is added.
 
D

Douglas J. Steele

You can't use dbOpenTable with linked tables. Either drop that parameter, or
replace it with dbOpenDynaset.
 
Joined
Sep 4, 2009
Messages
1
Reaction score
0
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
>
>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top