Choosing "Product" and "Price" together in a form

Elephant

Registered User.
Local time
Today, 06:40
Joined
Nov 22, 2002
Messages
52
I am making a database for a travel company. When a new booking is being added I want to choose a Product, such as a Hotel, and have the price for that product automatically appear when its selected.

ie, Mr Smith makes a booking at Hotel Sunshine - I go to the "Orders Form" and start inputting this. I select "Hotel Sunshine" from a drop-down list, and when this is selcted, the prices for Hotel Sunshine appear ....

Is it possible?
 
Yes this is possible.
One way is to create a table with lets say
HotelId, HotelName, Price1, Price2, etc
Although you can to this on one form, you can create one form to enter / edit this information and another to show the info you're talking about
On the second form you'll have to put the list or combo box (with a filter to e.g the HotelID) and the field(s) that have your price(s). With the AfterUpdate property of your listbox set properly you will see the appropraiet price(s) in the box(es) when clicking on a choice in the box
Hopes this gets you going
 
One way to do this has to do with parent/child forms.

You need two tables.

Table: Hotel
-- IDcode (Primary Key)
-- Name
-- other data (location, phone, manager's name, etc.)

Table: RoomClass
-- IDcode (Foreign Key)
-- ClassName
-- Rate
-- other data

Make the combination of IDCode and ClassName your primary key (a compound key).

Now make a form for selecting the Hotel. Make a subform that lists the room classes. Use the wizard to insert the subform into the main form. The wizard will ask you what field represents the link between the two. Your answer will be IDCode (from my example) or whatever you choose to call this field in your tables.

If you have the fields linked, then selecting a new Hotel automatically selects a new subset of accomodation classes (rate tables).
 

Users who are viewing this thread

Back
Top Bottom