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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using multiple forms with the same query

Status
Not open for further replies.

PCX

Technical User
Dec 17, 2000
54
US
I have a tab control that has seven tabs (one for each day of the week). Each page has a subform that uses the same query as the source. The data in the query can be sorted to display only data for each day of the week by changing the criteria of the dayofweek record in the query.

How can I load the subform to change the query for each day of the week?

There must be a way to tell the subform that the query should only show records for Monday when the Monday tab is active and Tuesday when it is active.

For some reason I am brain dead today and can't seem to make it work.

Thanks
 
I would set the LinkChildFields and LinkMasterFields of the subform control equal to a field that represents the week. That way, when the week changes on the main form, the subform will automatically change to the week specified.
 
That may work for some forms but the main form in this case does not get it's source from that query and is unbound.

I guess what I am asking is if there is a way to use the same query/subform on each of the tab sheets. It seems like it should be easy but so far, nothing I've tried seems to work.

Thanks for the help
 
The main form does not have to be bound. The 2 numbers between the main form and subform just need to match.

Suppose the main form has a combobox (cboDayOfWeek) from which the user can select the day of the week. The combobox may contain 2 columns: DayOfWeek;WeekDay (i.e. 1;Monday). And suppose the day of the week the user selects is Monday (1). The LinkMasterField would equal cboDayOfWeek and the LinkChildField would equal the field on the subform that represented the day of the week.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top