Query run again

  • Thread starter Thread starter cmichaud
  • Start date Start date
C

cmichaud

I have a parameter query that is fed by 3 combo boxes on a form. the
combo boxes include an "all" selection. there is a button to click to
run the query. it works fine. the problem is that after i run it i
have to close the results it gives before running another one. I would
like to be able to do the search immediatly again and have it just
refresh or update. Also i would really like for the resutls to be
displayed on the form. how do i do this. this is my current sql query

SELECT ClubInfo.[Club Name], ClubInfo.[Club Leader], ClubInfo.SexID,
ClubInfo.AgeID, ClubInfo.ClubCityID
FROM ClubInfo
WHERE
(((IIf(forms!clubsearch_form!ageID="(All)","",ClubInfo.AgeID=forms!clubsearch_Form!AgeID))<>False)
And
((IIf(forms!clubsearch_Form!SexID="(All)","",ClubInfo.SexID=forms!clubsearch_Form!SexID))<>False)
And
((IIf(forms!clubsearch_Form!ClubCityID="(All)","",ClubInfo.ClubCityID=forms!clubsearch_Form!ClubCityID))<>False));

thanks
caleb
 
I have a parameter query that is fed by 3 combo boxes on a form. the
combo boxes include an "all" selection. there is a button to click to
run the query. it works fine. the problem is that after i run it i
have to close the results it gives before running another one. I would
like to be able to do the search immediatly again and have it just
refresh or update. Also i would really like for the resutls to be
displayed on the form. how do i do this. this is my current sql query

SELECT ClubInfo.[Club Name], ClubInfo.[Club Leader], ClubInfo.SexID,
ClubInfo.AgeID, ClubInfo.ClubCityID
FROM ClubInfo
WHERE
(((IIf(forms!clubsearch_form!ageID="(All)","",ClubInfo.AgeID=forms!clubsearch_Form!AgeID))<>False)
And
((IIf(forms!clubsearch_Form!SexID="(All)","",ClubInfo.SexID=forms!clubsearch_Form!SexID))<>False)
And
((IIf(forms!clubsearch_Form!ClubCityID="(All)","",ClubInfo.ClubCityID=forms!clubsearch_Form!ClubCityID))<>False));

thanks
caleb

Why not make the query a QueryDef. Then make a Datasheet form w/ the
RecordSource equal to the name of the QueryDef. To run/re-run the
query, just change the ComboBox parameters and .Requery the form (use a
CommandButton to requery the form).
 
Back
Top