Requery form does not work

AshikHusein

Registered User.
Local time
Today, 17:13
Joined
Feb 7, 2003
Messages
147
I have a form in which the boxes on the top part of the form accept the criteria which go into making up an SQL statement which then helps build up a query using querydef.

The fields in the bottom part of the form are bound to the query created above using querydef.

When I change the query, (which I do by changing the critieria on the top part of the form) and click on the button which has the code to build up the query, the form does not refresh with the query with the new set of criteria.

In the code, at the end, I use the following:

forms("the_current_form").requery

To load the re criteried query I have to close and open the form again.

What am I doing wrong? Thanks. :banghead:
 
Perhaps this will help.

With A2007, I found it necessary to both remind the form of the DAO.QueryDef it is bound to AND fire the Refresh event in order to see newly added records in a Multiple Items form.

Code:
  'Update the Form UI with the table contents
  Me.RecordSource = ObjMultipleItemsFormsInit.GetDAOQueryDefName(Me.Name)
  Me.Refresh
I have a custom class to keep track of the queries that Multiple Items forms are attached to. But that call merely pastes in the RecordSource value AGAIN that RecordSource is already set to. If I did not do that, I can .Refresh all I want and the record would not show up.
 
Thanks for the great help!! That worked like a charm!! Really appreciate it!
 
You are most welcome, AshikHusein. Thank you for your kind reply.
 

Users who are viewing this thread

Back
Top Bottom