combo boxes in Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm attempting to do my ICT coursework, building a system in access. However
I have got stuck on one particular thing. I have a list of items in a combo
box, in a form, but I want it so that if I select one item the correct cost
will come up matching it. I kind of need to do it asap so if any one could
help i'd be grateful. People say there is stuff to help on microsoft office
online but i dont understand the explanations given.
 
Since you are trying to retrieve the current cost (I assume this comes from
a related product table?) then you will want to select the part number and
have Access pull in the part number and the cost from that table. You will
then want to populate a field in your form to store this cost.

Rather than simply give you the answer, I'd suggest you take a look at the
Northwind database that ships with MS Access. Take a look at how it handles
items in the ORDERS form. I believe it does exactly what you are trying to
do.

If you need more help, feel free to post back.

--
Rick B



"lil_blu_elephants_rock:)"
 
Thanks but I don't quite get it, i think i didnt explain it right. I am doing
a project to make a system for a hairdressers. I have an appointment booking
form which has many details however there is a field for Type/Style and one
for cost. I would like to be able to select a style... and for the cost to
change automatically. I looked at the example you gave me yet still can't
work out how to do it.

Thanks again :D
 
In Northwinds, you select a part number, and it defaults in the cost for
you. In your database, you will select the Type/Style and it will fill in
the cost for you. These are exactly the same functions.

If you have a table where you are storing the "Style" and the "Cost" then
you are all set. Just emulate what Northwinds is doing. Instead of
selecting a part, you will select a style.
 
Wow thx it works and it was one of those things that i knew how to do but
couldn't pick up on it.

Thx a lot
 
I have looked at the NorthWinds database. I understand how they created the
Combo Box for the Product name. The is coming from the Products table.
However, I do not understand how the UnitPrice text box is linked to the
Products table. It appears that the prices are coming from the Products
table and all of the data entered into this form is stored in the Order
Details table.

Thank you for your help.

Irene
 
I found there was an After Update Event in the UnitPrice text box. I have
never programmed in VB, but attempted to copy the code. Please tell me what
is wrong with the code below:
Once Program Name is selected from the combo box, I want to look up the
Passes associated with that program name and put it in the Total Passes text
box.

Private Sub Total_passes_AfterUpdate()
Dim strFilter As String
strFilter = "Program Name = " & Me!Program_Name
Me![Total Passes] = DLookup("Passes", "MCS Program Table", strFilter)
Exit_Total_Passes_AfterUpdate:
Exit Sub

End Sub
 
Back
Top