• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Using combo boxes in Access

justinoh

Member
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!
 
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
 
Back
Top