Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show query results in subform. PLEASE HELP! 1

Status
Not open for further replies.

setchae

Technical User
Oct 15, 2003
2
0
0
US
Currently, I have 4 Date and Time Picker controls allowing the user to select the starting and ending dates and times to perform a search. The only way I have been able to get this to work is to include a command button that executes the query. The problem with this is the query pops up on the screen.

I want the records to be displayed in the subform instead. Is there an easy way of going about this?

Thank you for your time!

Sincerely,

Brandon
 
Have the record source for your subform be a query that uses the controls on your form for the criteria (date1 = forms!formname!controlname, etc)

Then have the button requery the subform.

-Coco

[auto]
 
coco86 is absolutely right. Here are some tips to implement his idea.

When you are in the query design view, put the cursor in the criteria row under the appropriate field. Then, click on the magic wand to start the expression builder. In the expression builder, choose forms, then all forms, then the form name, then the control name. When you choose the control's name the appropriate code will appear in the expression builder.

When you put the input object on the form, be sure that it is unbound (ie, it should NOT have a control source).

The refresh button's actual code may be a bit more complex than coco86 indicates, but his basic idea is sound.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top