Solved Error An object is needed

One more fix. You keep on discovering things, I had not thought about.
The FAYT works by using the recordset property of the combobox. This is what allows me to make a generic class without having to work with the SQL string. What is interesting is that the recordset sometimes does not exist until you actually pull down the combobox choices. That is why I had this code originally.

Code:
  If mCombo.Recordset Is Nothing And Not mCombo.RowSource = "" Then
     Set rs = CurrentDb.OpenRecordset(TheComboBox.RowSource)
     Set mCombo.Recordset = rs
  End If

This will force the recordset to load. You demonstrated a similar problem. You change the rowsource and even requery; however the recordset is still the old recordset. So, i simply need to force the recordset to load by making the if then less restrictive.
Please change to

Code:
   If not mCombo.RowSource = "" Then
     Set rs = CurrentDb.OpenRecordset(TheComboBox.RowSource)
     Set mCombo.Recordset = rs
   End If
 
Perfect. I'm sorry if I try to discover new problems with so much.

One last thing. If you select an option of the Genre combo first, using the mouse, the combo list remains visible. I attached capture.

Thanks a lot.
 

Attachments

  • ScreenShot001.jpg
    ScreenShot001.jpg
    100.7 KB · Views: 138
Try this update in the filterlist.

Code:
....
Else
    beep
    mAutoCompleteEnabled = True
  End If
  Set mCombo.Recordset = rsTemp
  If rsTemp.RecordCount > 0 Then
    'add code here
     [COLOR="Red"]If Nz(mCombo.Value, "") <> Nz(mCombo.Text, "") Then mCombo.Dropdown[/COLOR]
  End If
.....
 

Users who are viewing this thread

Back
Top Bottom