Error "Method or data member not found" on requery (1 Viewer)

peter2012

Registered User.
Local time
Today, 09:58
Joined
Apr 11, 2012
Messages
24
I have a form (frmTimecardsDataEntry3*) that needs to requery combo boxes to narrow down the selections offered in the dropdown of each combo box.

It is a data entry form. I.e. Dataentry is set to yes.

The ClientName combo box has an after update event which requeries the matter combo box, so that the MatterName combo box dropdown only shows the matters relating to that client. This works just fine.

The MatterName combo box has an after update event which requeries the Rate combo box so that in the Rate combo box dropdown only the hourly charge rates relating to that matter are shown. That works too. So far so good.

I then tried adding another after update event to the MatterName combo box, so that another combo box, Application, was requeried too, so with the Private Sub it looked like:

Rate.Requery
Application.Requery

But this resulted in the error in the title to this post and the debugger highlighted in red the word Requery in the phrase Application.Requery.

I thought maybe Access does not allow two requeries resulting from one after update event, so instead I took Application.Requery out and placed it as an after update event in another combo box which did not have any other after update events to run.

However, this resulted in the same error.

So the error appears to have something to do with trying to requery the Application combo box but I cannot see what is causing the error.

The Application combo box SQL is:

SELECT Applications.ApplicationID, [ApplicationDate] & " " & [ApplicationName] AS ApplicationDisplay, Applications.ApplicationDate, Applications.ApplicationName, Applications.MatterName
FROM Applications
WHERE (((Applications.MatterName)=[Forms]![frmTimecardsDataEntry3*]![MatterName]))
ORDER BY Applications.ApplicationDate, Applications.ApplicationName;

This is the same arrangement of SQL that I am using on the other requeried combo boxes that work. When I take the WHERE statement out of the Application SQL and run it the query returns all of the applications.

I am not sure what the error code is trying to tell me about the attempt to requery the Application combo box.

Forgive me as a newbie but what does this error mean in plain English?

Another point, in case it is a symptom of the problem. I have a yes/no box in the form and when the firm is first opened it has a small square dot in it, but as soon as any data is entered in the form the dot clears and leaves the usual empty tick box that you would expect to see.

Also, another possible symptom is that I had another version of this form previously working quite well except that when I did several data entries all at once, so I had several forms filled in with different data (before refreshing and thus entering the data in the table), when I scrolled between the forms I kept losing the MatterName data when I scrolled back, and then when I re-entered the ClientName data the correct MatterName data returned without me having to use the dropdown to select it.

I have had an earlier simpler version of this form working for some time, with ClientName requerying MatterName and MatterName requerying Rate, and I am using the same SQL structures in the new form but getting the error in the title to this post and the other isues just described.

Would be grateful for any insights.

Peter
 

peter2012

Registered User.
Local time
Today, 09:58
Joined
Apr 11, 2012
Messages
24
Thanks JHB, that fixed the error message issue!

On the other issues, for the benefit of others who might encounter the same problems:

On the issue about data disappearing where I completed more than one record at a time before refreshing/saving, and moved from one record to the next, that was fixed by adding the following events:

Private Sub Form_Current()

MatterName.Requery
Rate.Requery

Applications.Requery

End Sub

On the issue of a square appearing in the yes/no box, fixed by making that box/field default to No.

Peter

 

Users who are viewing this thread

Top Bottom