Solved

Showing a subset of data based on dropdown

Posted on 2013-01-26
2
190 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

809 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