By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,393 Members | 1,537 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,393 IT Pros & Developers. It's quick & easy.

Drop Down Box Problem

P: 2
I need to use a drop down box based on table Color that, once you click on a value, populates the field in my form

In the main database design, I reference the Table Color, both the ID and the description. For the description field, I ran the lookup wizard, refering to the Table Color, Selecting just the Color field (not the ID).

The display control is a combo box (default by access), with row/source type of Table/Query, and row source
SELECT Color.ColorID, Color.Color FROM Color OREDRE BY [Color]
Bound Column is 1, with Column Count of 2.

BUT when I open the form, the color description field was blank. The properties on that are:
Control Source ColorDesc
Row Source Type: Table/Query
Row Source is blank
Validation Rule and Text are blank

So, two issues: First, obviously my drop down list is not working.
Second, I want it to save the value I click in that form once the list works.
Dec 14 '07 #1
Share this Question
Share on Google+
1 Reply


puppydogbuddy
Expert 100+
P: 1,923
To fix your combobox, go to the row source property and click the build button(the one with 3 dots) on the right. This should take you to the query grid. You will see that there is no description because the lookup table for description needs to be added to the grid. Click the add/show button, select the lookup table, and add it to the table area of your grid. Then drag the description from the lookup table to the field area of your grid next to the ID. Make sure the show box is checked. Save and go back to property sheet; set col widths property to 0";2".

To fix your testbox for Color Description, set its control source to the color description field in your table, and place the following code behind your form:

Private Sub YourCombo_AfterUpdate()
Your other code ..........
Me!Color = Me!YourCombo.Column(1)
End Sub
Dec 14 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.