Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

How make subform display only certain records

I have a form that has a sub-form.  When the form opens (with the subform), I want only certain records to display in the subform. that relate to the ID in the main form.  

For of all the link between the 2 form is ID.  

But I want the subform to display only the records that have TRNX_TYPE being "I" (letter I, not 1), and DATE_RECD is not null

Its like the subform should open with:  TRNX_TYPE = "I" AND DATE_RECD is not null

How can I make the subform only display those records?
ASKER CERTIFIED SOLUTION
Avatar of Simon
Simon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Copy the query the subform is based on and call it something like  qTRNX_TYPE_I
Put "I" in the criteria of the TRNX_TYPE field
Put Is Not Null in the criteria of the DATE_RECD field

Then put a command button in the header of the subform that does this in the OnClick Event
Me.RecordSource = "qTRNX_TYPE_I"