Solved

How make subform display only certain records

Posted on 2014-11-28
2
805 Views
Last Modified: 2014-11-28
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?
0
Comment
Question by:SteveL13
2 Comments
 
LVL 18

Accepted Solution

by:
Simon earned 500 total points
ID: 40470492
>>Its like the subform should open with:  TRNX_TYPE = "I" AND DATE_RECD is not null

Add a filter to the subform properties and set filter on load to true
((([TRNX_TYPE]="I"))) AND ([DATE_RECD] Is Not Null)

Or, add a where clause to the datasource query for the subform. If it's currently bound to a table, make the query
SELECT tblTransactions.*
FROM tblTransactions
WHERE (((TRNX_TYPE)="I") AND ((DATE_RECD) Is Not Null));

Open in new window


Which of these options you want depends on your scenario. If you use the filter option, it sets the initial load condition, but users can remove the filter to see the other records. If you do it with a WHERE clause then they can't
0
 
LVL 23

Expert Comment

by:Eirman
ID: 40470538
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"
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now