View Full Version : Form with combo box, where chosen value causes the rest of the form to populate


mles
03-21-2000, 12:57 PM
I have a table that contains these fields: ID, JobNumber, Title, Date. I want to make a combo box for JobNumber so that I can choose a value for JobNumber, and have the other fields on the form autopopulate with information from the table. I'm sure this is really obvious and I'm just missing it.

Pat Hartman
03-21-2000, 01:48 PM
There are examples of how to do this in northwinds.mdb and solutions.mdb

mles
03-21-2000, 02:01 PM
SELECT DISTINCTROW tbl_OffsiteCDs.CDID, tbl_OffsiteCDs.JobNumber
FROM tbl_OffsiteCDs
ORDER BY tbl_OffsiteCDs.JobNumber;

is the code I'm using for the query from the combo box JobNumber. But choosing a JobNumber in the combo box is NOT updating the other fields on the form. What's wrong?

Pat Hartman
03-21-2000, 08:09 PM
Open the northwinds.mdb (if you can't find it on your hard drive, go back to the Access installation CD and select the option to load sample databases. That will install northwinds.mdb, solutions.mdb, and orders.mdb).

Open the main switchboard form (if it doesn't open automatically).

Press the Orders button.

Press the >* button at the bottom of the form to go to a new record.

Select a customer from the BillTo combobox and watch the other form fields populate.

Switch to design view and look at the code associated with the events of the combobox. The code is very simple, you shouldn't have any trouble understanding it.