combobox blank

  • Thread starter Thread starter deb
  • Start date Start date
D

deb

using access 2003
I have a combobox called ContactID.
I want the row source to contain only records where ContactStatus = active.
If I set the RowSource to show only "Active" in the drop down selections,
and there is a ContactID that has ContactStatus = INactive it will show as a
blank in the ContactID field.

I want the ContactID field to show, but the drop down list to only show
ContactId's that ContactStatus = active
Thanks
 
Is this a single form view? If so, you could consider modifying the Row
Source SQL to a query that select where status = active or ContactID = the
current contactID value. The code would need to run in the On Current event
of the form.

Dim strSQL as String
strSQL = "SELECT ContactID, ContactName " & _
"FROM tblContacts " & _
"WHERE ContactStatus ='Active' Or ContactID =" & Me.ContactID
Me.ContactID.RowSource = strSQL
 
Back
Top