Query and a Subform

  • Thread starter Thread starter Raymond Clarke
  • Start date Start date
R

Raymond Clarke

I have a form which contains a subform. When the form is
first started a user is prompted to select the criteria to
dispay in the subform (datasheet view). Once the user
updates the information, I would like to have a button to
rerun the query based on new criteria and display the new
results. I am having some problems accomplishing this. I
appreciate all the help in advance.

Thank You,

Raymond
 
I assume that the query in question is using values from the form as
parameters? If so you just need to requery the subform by putting code like
this in a suitable event handler:

NameOfSubformControl.Form.Requery

This code could go in the click event of a command button which will do
exactly what you're asking for. Alternatively it could go in the AfterUpdate
event of the control that holds the criteria value so the user is spared the
effort of clicking a button. Personally I'd go for the AfterUpdate event if
there is only a single criteria, and the button if there are multiple
criteria.
 
Back
Top