combo box updating

cynwalker

New member
Local time
Today, 11:40
Joined
Oct 22, 2013
Messages
1
I have a form with 2 unbound combo boxes, one for project name and one for project numbers. Project name gives a drop down box listing project names and project number gives a list by numbers. Both are getting the information from the same table. A sub form then updates from the choice of the combo box. All of this works fine. The thing I can't figure out how to do is update the other combo box based on the choice made, i.e, if I choose project number automatically update the project name combo box and vise-versa. Both boxes use the following macro in the After Update event:
SearchForRecord
Record First
Where Condition = ="[proj_no] = " & Str(Nz([Screen].[ActiveControl],0))

Any help would be appreciated.
 
Begin with the one side first and I don't even think it's feasible.

So I'll base my example on this one "if I choose project number automatically update the project name combo box"

1. In the Row Source (i.e. the combo box's query) of the Project Name combo box, enter the following criteria to the Proj_No field and add the reference to the Parameters list:
Code:
[Forms]![FormName]![Proj_No] Or [Forms]![FormName]![Proj_No] Is Null
... it needs to be put in the same cell not on different lines.
2. In the After Update event of the Project Number combo box, requery the Project Name combo box:
Code:
Me.cboProjectName.Requery
By the way, it's a bit redundant doing this because Proj_No and Proj_Name are in the same table and the records are a one-to-one mapping (I would imagine).

Welcome to AWF! :)
 

Users who are viewing this thread

Back
Top Bottom