Solved

Showing a subset of data based on dropdown

Posted on 2013-01-26
2
169 Views
Last Modified: 2013-01-26
This must be easy ... but I have been struggling a bit.

1. I own 4 hotels (pretend!).  Hotel East, Hotel West, Hotel North, Hotel South

2. I analyse my hotel customers into sources such as, "Families", "Business", "Golf" etc.

3. At the end of each month I input the sales per source per hotel per week.  E.g. Hotel East has 33 bookings for Families in the week ending December 31st.

4. QUESTION: See frmShowSpecificBookings.   Firstly I choose a week at the top of the screen.  How to I show ONLY those weeks bookings in the subform below (frmBookings).

PS: I am fairly sure I use a query in the subform that has Forms!frmShowSpecificWeek!WeekID etc.    However, I have been unable to implement this fully.
Database1.accdb
0
Comment
Question by:Patrick O'Dea
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 38821881
1. Add the field tblWeeks.WeekID to qrySalesDetails

2. Add this code to the AfterUpdate of Combo0:

Me.frmBookings.Form.RecordSource = "SELECT * FROM qrySalesDetails WHERE WeekID=" & Me.Combo0.Column(0)

That will show all records for all Hotels associated with that specific record in "tblWeeks".
0
 

Author Closing Comment

by:Patrick O'Dea
ID: 38821890
Thanks, Perfect!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

744 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

10 Experts available now in Live!

Get 1:1 Help Now