Combo box on Form

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

Guest

Hello,

I have a form that has two ways of looking up records: a combo box with
Client names pulled from a table and a text box allowing user to type a
Client code. Is there a way to have the form load up without automatically
populating the combo box unless the user clicks that control? I hate having
the user wait unecessarily. Any ideas are very appreciated, thanks!
 
A suggestion from a bit of a newbie:

I have been shown what sounds like similar functionality
that works like this. 1. Create an unbound combo box with
a record source of the client code in the record set
which is the record source for the form. 2. Put the
following code (adapted if necessary) in the combo box's
AfterUpdate event:

Sub FindClient
Dim rs As Object
Set rs = Me.Recordset.Clone
' Find the record that matches the control.
rs.FindFirst "[ClientCode] = " & Str(Me!
[cboSelectAClinic])
Me.Bookmark = rs.Bookmark
End Sub

3. Have its initial value set to zero-length string on
the form's OnOpen event (or have its value updated to the
text box's in the OnCurrent event to keep it in sync with
the current record).

Just a suggestion.

Darrell
 
Back
Top