Update form based on query

SeanDelere

Registered User.
Local time
Today, 11:48
Joined
Sep 7, 2004
Messages
51
I have created a form based on a Query.

I have a text box which is the source for the criteria of one of the fields in the query.

When I enter data into the text box it passes this to the query criteria. I know this works because if I open the query by double clicking on it the records are sorted as I would expect.

My problem is that the form does not show the effects of the criteria being entered.

I have searched the helpfile and can't find how I update the form to "read" the query once the criteria has changed.

Can any kind soul tell me what I am doing wrong as it is driving me mad!
 
Sean,

If I understand you correctly, you can use the AfterUpdate event of the
"unbound" criteria field and just do a Me.Requery. That will refresh the
form's data.

Wayne
 
Thanks for taking the time to help.

I tried putting Me.Requery in the code section of the AfterUpdate for the text box but the form still does not update although ooking at the actual querry itself shows the sorted results as ecpected.

Do I need to add anything else apart from Me.Requery such as which Query to update?

What I am trying to achieve is to check if a record exists in a field and if it does go to that record for editing. If it doesn't exist I want to add a new record and check to see what the last record entered was.
 
Progress Report:

I have now got the form to update the Query. Many many thanks Wayne!

The text box that passes the criteria to the query comes from two other text boxes.

=[Text29]+[Text33] (this gives a result in the form of ABC1234)

I am now playing with all the possible Events for the text box to try and get the query to update when the value changes rather than having to click it. I would have though "after update" or "On Change" would have done it but apparently not.
 
do you have a setting in the form properties that is overriding the query's sort order?
 
I can't see anything that could be overriding things.

It is not the end of the world though, for now I will put a button on the form that has to be clicked to update it.
 
I have a problem with a similiar situation..hoping someone can help. I have a form based on a query..I have multiple fields ...field X has a number and I am trying to input into field Y and get the results in Field Z...Field Z has a calculation. But it the query resilts 14 records and I put an input into field Y..the input shows in all 14 records...Field Z shows the results..just trying to figure out why the input is not for just the one record..Anyone help!!!
 

Users who are viewing this thread

Back
Top Bottom