Combo box to control two sub forms

D

DevilDog1978

I have a combo box on a form that I want to control the data viewed in two
sub forms. The combo box list months in the mmm format. One of the sub forms
is requests that have been approved with the date (mmm-yy) the other sub form
is requests that have been denied with the date (mmm-yy). When I select Jan
from the combo box, I want the sub forms to display only the records having
to do with that month. Is this even possible?
 
S

Steve

Your combobox provides only a month criteria while your data is both year
and month. That's not a problem except when you select a month, your subform
data will me for the month in all years.

mmm-yy is text so you can use text functions. Use a query as the
recordsource of both subforms. In a blank field type:
RequestMonth = Left("[NameOfDateField]",3)
Put the following expression in the criteria of RequestMonth:
Forms!NameOfMainForm!NameOfCombobox

Steve
(e-mail address removed)
 
J

John W. Vinson

I have a combo box on a form that I want to control the data viewed in two
sub forms. The combo box list months in the mmm format. One of the sub forms
is requests that have been approved with the date (mmm-yy) the other sub form
is requests that have been denied with the date (mmm-yy). When I select Jan
from the combo box, I want the sub forms to display only the records having
to do with that month. Is this even possible?

You could base each subform on a Query including a field

ReqMonth: Format([datefield], "mmm")

Use this field as the Child Link Field of the subform, and the name of the
combo box as the Master Link Field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top