Got a question on linking fields in a form

B

Brent E

Good afternoon.

I setup a table that has combo boxes setup to enable a drop down lists for
an user to select an office name and an office number. I am curious if there
is a way to make the table auto populate the office number field, based on
which office a user selects? Thanks.
 
A

Arvin Meyer

As the controlsource of Combo2, use something like:

Select * From MyTable Where OfficeName = Forms!MyForm!CBOCombo1

In the AfterUpdate event of Combo1, and event procedure like:

Sub Combo1_AfterUpdate()
Me.Combo2.Requery
End Sub
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Top