Is it possible

B

Balisteve

Hi from sunny Bali new to Access and this group, hope someone can help.
I am trying to design a form which has a drop down list box of a number of
different packages that our supplier provides, I would like to have another
control (field???) that is automatically filled in with the package price
once our staff have chosen the particular package eg from the list the
staff choose "Rafting Only" in the package price box it automatically
displays the price for that package etc.
Try to keep it very simple if possible please I am really beginner, and
still don't fully understand Acces and all the relationships/queries etc.
Thanks anyway
 
D

Dennis

Is the package price a column in the drop down list ?
If yes, then simply set the control source property of your price text box to
=[YourDropDownBoxName].Column(1)
(substitute the correct column number for where your price appears in the
dropdown)
If the price is not in the drop down list then you can get it from the table
using a DLookUp as the control source for your price text box
=DLookUp("[PriceFieldName]","[PackageTableName]","[Package] = '" &
[YourDropDownBoxName] & "'")
 
R

Ron2006

Implications, implications, implications.

You have not explained much about what you are doing so any of our
answers may solve your stated question but may NOT be the best for
what have have designed and NOT told us.

Denis's code is completely accurate and acceptable IF all you want to
do is SHOW the current price

If the form is bound to a record and there is a field in it for
package and price then his answer will not be advisable. In that case
the package combo would be bound to the package field in you record
and you should load the value of the package price into the price
field in the afterupdate event of the combo. Easiest way is to have
package and price in the query for the package and in the afterupdate
event
me.recordnameforprice = me.combonameforpackage.column(1) -
this assums that the price is the second field in the query on which
the package combo is based.

The reason for this is that when you change the price and look at an
old record, Denis's solution will show the current price (look as if
he paid the current reduced or higher price) and the alternate
solution will show the old price UNTIL and ONLY IF you do NOT change
the package again, in which case it will load the new price.

BOTH answers are correct but both are based in insufficient knowledge
of what you are really doing.

Ron
 
B

Balisteve

Thank you for your reply, It works a treat, thank you thank you, spent all
day yesterday trying to work out how I could do it, and it turns out to be
simple.
The girls on the desk say thank you too, as it now saves them trying to
remember the suppliers price for the packages, you should have seen the
smiles on their faces when I told them it could be done.


Dennis said:
Is the package price a column in the drop down list ?
If yes, then simply set the control source property of your price text box to
=[YourDropDownBoxName].Column(1)
(substitute the correct column number for where your price appears in the
dropdown)
If the price is not in the drop down list then you can get it from the table
using a DLookUp as the control source for your price text box
=DLookUp("[PriceFieldName]","[PackageTableName]","[Package] = '" &
[YourDropDownBoxName] & "'")

Balisteve said:
Hi from sunny Bali new to Access and this group, hope someone can help.
I am trying to design a form which has a drop down list box of a number of
different packages that our supplier provides, I would like to have another
control (field???) that is automatically filled in with the package price
once our staff have chosen the particular package eg from the list the
staff choose "Rafting Only" in the package price box it automatically
displays the price for that package etc.
Try to keep it very simple if possible please I am really beginner, and
still don't fully understand Acces and all the relationships/queries etc.
Thanks anyway
 
B

Balisteve

Thank you also for your reply, I have used the previous posters suggestion,
as it is the most simple for me to do, I am only doing this because the
contractor who was doing it for us previously left for a more lucrative
contract in America, and didn't finish the work. I am not worried about
looking at old records especially suppliers prices, as we are a Travel
Service company, and the bookings for our packages come from tourists who are
already here, and tsake the package on the same day and probably only have 1
or 2 from us during their stay. We add our mark up to the suppliers price as
part of the booking system.

Thank you again, I have kept a copy of your suggestion, in case in future I
both understand Access better, and have the need to change the way we
complete our booking system.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top