Library Reference Problem

rdg0351

Registered User.
Local time
Today, 11:48
Joined
Nov 29, 2010
Messages
19
I recently "dusted off" an older application, Access 2010 running under XP. I went to make some changes in a Win 10 Pro environment, and discovered that just about all the RecordSet operations failed. In particular, I have a simple screen that generates the following error code: "Operation is not supported for this type of object." I believe it is a Library Reference order problem, or something similar. The code is as follows:

Dim stLinkCriteria As String
Dim tblOperator As DAO.Recordset
Set tblOperator = Application.CurrentDb.OpenRecordset("Operators")

cboOperator.SetFocus
If cboOperator.Text = "" Then Exit Sub

tblOperator.FindFirst "Operator = '" & glbOperator & "'" (IT BOMBS HERE)

tblOperator.Edit
...

Does anyone have a sense of direction for this issue? Thank you in advance
 
I think that if there was a reference error you'd get a "User defined type not defined" compile error and your code would fail to run.

What looks more suspicious is that you check the value of cboOperator and you Exit Sub if it is missing, but then you don't use that value, you use glbOperator. Maybe you have those two identifiers confused? Where does glbOperator get it's value? Why don't you error check that value?
 
I left some code out to protect the innocent. The variable glbOperator is the value entered from a login form. It's then supposed to validate the userid against a table, i.e. Operators. So, when it does a .findfirst, I get the error. I believe it has something to do with the libraries used, but I can't figure out which ones are to be included and the order.

Once again, thanks in advance
 
is your Operator field numeric? if so, remove the single quotes - also double check the field has not been defined as a lookup field which typically is numeric but displays text

if you think it is libraries - what libraries are you using? Perhaps you are using an old one that is in conflict with DAO
 
Thanks to everyone who responded. It appears that the problem is related to the "default" DAO access method. By adding "dbOpenDynaset " to the FindFirst command, the code executes as expected. Thank you
 

Users who are viewing this thread

Back
Top Bottom