Here's a step-by-step; you'll have to replace all Field names with your actual names:
Place a Combobox on your Form. When the Wizard comes up
- Select "I want combobox to look up values in a table/query"
- Select your Table or Query
- Click to move County to right hand box
- Click to move MealAllotments to right hand box
- Click to move LodgingAllotments to right hand box
- Sort by County field
- Select "Remember Value for Later Use"
- Chose a caption for label (if desired)
- Click on Finish
Now, assuming that the Fields, in the Combobox, reading from Left-to-Right are
County | MealAllotments | LodgingAllotments
in the AfterUpdate event for your Combobox use this code:
Code:
Private Sub YourComboBoxName_AfterUpdate()
Me.County = Me.YourComboBoxName.Column(0)
Me.MealAllotments = Me.YourComboBoxName.Column(1)
Me.LodgingAllotments = Me.YourComboBoxName.Column(2)
End Sub
and Bob's your uncle! Notice that the Column Index is Zero-based.
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007