Solved

Showing a subset of data based on dropdown

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

828 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