Change rowsource on combobox in OnEnter event



I have a combo box on a tab object of an Access 2002 form that contains a lot
of records (30000+). To increase the form speed, I set the original
rowsource for the combo box to only the record bound to that control so only
1 record is retrieved (because it is rarely changed after it is added). If
the user enters the combobox again, I have code in the On Enter event to
select from the DB again for all the records so the user can select any
record they would like.

My OnEnter event is as follows:
Private Sub cbobillclientcode_Enter()
strsql = "SELECT tblClient.clientcode, tblClient.lastname + ', ' +
tblClient.firstname AS client, tblCompany.intname " & _
"FROM tblClient INNER JOIN " & _
"tblCompany ON tblClient.companycode = tblCompany.companycode "
& _
"WHERE tblclient.status = 'Active' " & _
" ORDER BY Client "
Me.cbobillclientcode.RowSource = strsql

End Sub

I would expect the rowsource to change and the combobox to requery but it is
not changing. It still only contains the one record. I have checked the sql
in query analyzer and that works fine.

Any suggestions?
.



Relevant Pages

  • RE: Change rowsource on combobox in OnEnter event
    ... You also need to tell the combo box to requery to load the new values. ... My OnEnter event is as follows: ... Private Sub cbobillclientcode_Enter ... " ORDER BY Client " ...
    (microsoft.public.access.formscoding)
  • Re: Problem Using Delete Key Because of Combobox
    ... Private Sub ComboBox1_Change ... Dim myCell As Range ... The list and the combobox are both in the same sheet. ... I want it to populate whichever cell I ...
    (microsoft.public.excel.misc)
  • Re: Returning an Auto Text from a Combo Box
    ... Save that document somewhere and modify this line of code in the Private Sub ... the name of ComboBox1, when the userform is displayed, that combobox will be ... Set addressRange = Selection.Range ... ' Open the file containing the client details ...
    (microsoft.public.word.vba.general)
  • Re: Returning an Auto Text from a Combo Box
    ... Save that document somewhere and modify this line of code in the Private Sub ... the name of ComboBox1, when the userform is displayed, that combobox will be ... Set addressRange = Selection.Range ... ' Open the file containing the client details ...
    (microsoft.public.word.vba.general)
  • Re: RE: User Forms
    ... Both the listbox and combobox are set to display the ... Private Sub FillCboBox ... Dim SrcData As Range ... For Each cCell In SrcData.Cells ...
    (microsoft.public.excel.newusers)