Combo Box Records

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

Guest

Hello,

I have a combo box in which I changed the table source from one table to
another. The new table has some of the same records as the previous table I
was using, but some of the records previously used are not in the new table (
ie. previous table had records: In Progress; On Hold; Completed; Awaiting
Input; Cancelled; Deferred; Inactive, etc. The new table has records:
Completed; Cancelled; Awaiting Input).

Previous records in my form that had used the records from the old table in
the combo box are now showing blank fields. I would like to be able to see
those records even though they are no longer options in the combo box for new
records. Hope this makes sense. Thanks.

Janet
 
Hi, Janet.

The combo box cannot display these options because those values do not exist
in its Row Source. You could, however, implement a combo box overlapping
with a textbox. Set the combo box' Visible property to Yes in design view,
and the textbox' Visible property to No.

Set the textbox' ControlSource to the same field as the combo box. In the
combo box' Exit event procedure, make the textbox visible, set the focus to
the next field, and make the combo box invisible.

Then in the textbox' On Enter event, make the combo box visible, set the
focus to it, and make the textbox invisible. Something like:

Private Sub YourCombo_Exit(Cancel As Integer)
Me!MyOverlappingTextBox.Visible = True
Me!MyNextControl.SetFocus
Me!YourCombo.Visible = False
End Sub

Private Sub MyOverlappingTextBox_Enter()
With Me!YourCombo
.Visible = True
.SetFocus
End With
Me!MyOverlappingTextbox.Visible = False
End Sub

You must do the operations in this order because an invisible control cannot
receive the focus, and you cannot set a control that has the focus to be
invisible.

Hope that helps.
Sprinks
 
Back
Top