?
Solved

How make subform display only certain records

Posted on 2014-11-28
2
Medium Priority
?
1,053 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
Simon earned 2000 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 24

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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

801 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