Updating combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with two combo boxes (the view is set to cont.). The user
selects a value from the first cmb and then assignes a value to the second.
I only want the user to see values that have not been used, so once 'John' is
selected his name will not appear in the next records cmb. This form is
actually a subform, so I am sure we will have to use the parent's unique id.
Can anyone help me with this?
 
For ComboBox2, add a WHERE ID <> YourForm.ComboBox1 to the query which fills
the ComboBox2 with values. Add an event AfterUpdate for ComboBox1 which
requeries Combox2 (Me.ComboBox2.Requery).

Linda
 
Thanks for your help. I guess my post was kinda confusing. It doesn't
matter that I have two combo boxes. I just want cboListOfNames on the first
record to list all names. Then, in the second record I want cboListOfNames
to show all names except the name select in the first record.
 
No, I think Linda has understood your question, and given you the right
answer, if the combo's are on the *same* record of the (continuous) subform.
May be a little more complicated if you're talking about *different*
records.
 
Thanks! They are NOT on the SAME records. I came up with this semi-
Psuedocode:

Select ALL Employee Names from tblEmployee WHERE recordset.count of
EmployeeID = 0 WHERE frmMain.txtDateID = tblSchedule.DateID AND
frmMain.cboShift.column(0) = tblSchedule.PosistionID

So if tblSchedule (from the subform) has a record that matches the DateID of
the main form AND the ShiftID of the main form then don't show the Employee's
name in the drop-down list.
 
Back
Top