Using combo boxes in Access

justinoh

Member
Nov 15, 2001
134
0
0
Hey guys!

I'm currently designing a petrol station database for a college project. How do I make a combo box which looks up certain values selected in a form?
For the table Petrol Pump, I have 4 fields which are PumpID, PetrolID, Pump Name and Max Volume. PumpID is the primary key here.

I'm trying to construct a data entry form where I select the Pump Name and the rest of the details for input like date and time of purchase (default value), volume purchased, Petrol Type and Price\Litre show up. In the combo box properties, I selected the correct control source (Pump Name) and row source (Petrol Pump). However, while using the form, upon selection of the combo box, Pump ID shows up in the combo box instead of the intended Pump Name.

Please help me out guys. I'm stuck at this phase of the project and can't proceed with the other forms, queries and reports! My dateline is coming soon!

Thanks a bunch!
 

bunker

Lifer
Apr 23, 2001
10,572
0
71
In the control source box, instead of selecting something from the dropdown, just type this in:

SELECT [Pump Name] FROM [Petrol Pump]; <-----not sure about the semi-colon.

EDIT - A little programming tip: when naming tables/columns etc... don't use spaces, makes a bit more complicated to refer to things that way. Try one of these conventions:
PetrolPump
Petrol_Pump