Update a field from another field

extreme486

New member
Local time
Today, 04:01
Joined
Jul 7, 2007
Messages
2
What i am trying to do i mist likely easy but i am just starting to mess around with access. When i am in my form i want to be able to select from a drop down box a room ( i know how to do the drop down box) and then once that room is selected have the price appear in another box to the side of it. I figured out how to do this through an IIF statement in the control source box but i need it to be bound to a field in my table this is where i run into trouble.

Sorry for the confusing explanation :confused: any help would be appreciated.

Thanks
 
A combo box can be made to look up one thing (like a room name) and store another (like a price) - if there is a table somewhere that lists room names and prices.

The above is an example of an Old Programmer's Rule: Access cannot tell you anything you didn't tell it first.

If there is a place to look up the price by name, a combo box is how you do that. Otherwise, this will only get trickier.
 
You should not add the price to your table if it is always available by calculating it in a query. Just knowing the room chosen is enough to get all the info needed at any time. If you later need to know the price, just use the formula in a query.
I don't know exactly what your database looks like, but I think that you could use the RoomPrice table in your main query instead of using the IIf.
If you need me to be clearer, maybe posting this part of your database would help.
 
How do I go about setting up the equation in a query?

I attached a copy of the database. The "invoice" form is the form that i am trying to manipulate There are 2 fields in there, one is 'RoomName' and the other is 'RoomPrice' I have the room names in a drop down box. I would like to select a room name and then the price of the room appear in the 'RoomPrice' box. Like i said above i figured out how to do this through an IIF (look below) statement but it is not bound to the 'RoomPrice' Is there a way to bind this?

Need some help, thanks


=IIf([RoomName]="The Florida Suite",”$130”,(IIf([RoomName]="The Pine Suite",”$150”,(IIf([RoomName]="The Mission Room",”$145”,(IIf([RoomName]="The Safari Room",”$125”)))))))
 

Attachments

Add the relevant prices to a second column in you lookup table
 

Users who are viewing this thread

Back
Top Bottom