Query on controls and subform

C

Carolinec

I've found out (through experimentation!) how to use a form to put in unbound
controls and then use VBA so that when I hit [OK] button (with the VBA in 'On
click') it opens up a query and form based on the data in the controls. So,
for example, I have a start date and end date. When I put the dates into the
unbound controls and hit OK, Voila, up pops the form based on the query. One
thing I can't figure out how to do is: What if I wanted to have the unbound
controls and the OK on one form and then in that form - a subform which pulls
up the data when I hit OK. I can't figure out the VBA code for that.

I hope I've explained myself correctly. Do feel free to tell me I make no
sense at all!
 
Ã

Özcan ELMALI

Hi,
first step,
create a new form and insert 2 unbound textboxes, named as txtStartDate and
txtEndDate
Close and save the form (frmOeman)
2. Create a new Query and insert all needed fields.
on the Criteria of the Date; Between [Forms]![frmOeman].txtStartDate And
[Forms]![frmOeman].txtEndDate
Save and close the query, (qryOeman)
3. Create sub form, base on qryOeman (frmSubOeman)
4. Insert a new Button, and on click, forms.frmSubOeman.Requery
if you need the Example, write to [email protected]

Best Regards
 
Top