Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

search combo box stopped working

Status
Not open for further replies.

tizwaz

Technical User
Aug 8, 2002
437
0
0
GB
Can anyone help. I have a combo box in a form header which searches for a particular record based on the ID in the combo. This was working previously and I don't know what has changed to stop it working but now when I select something in the combo box nothing happens.

Dim rs As DAO.Recordset

If Not IsNull(Me.cboSearchID) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[ID] = " & Me.cboSearchID
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If

I tried adding Microsoft DAO 3.6 object Library to the references but it said that caused a conflict - however I don't know with what or even if this is the issue
 
Double check the BoundColumn property of the combo ?
Did you try to run the code step by step to verify the values ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
boundcolumn is 1 and there is only 1 column which has the ID in - actually have just noticed it now works the 1st time you search but if you try again it does nothing
 
it does nothing
Even the MsgBox don't pop up ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
no nothing - it doesn't let you select another item in the combo - it moves to it but doesn't select it
 
Hopefully the combo is not bound (no ControlSource), isn'it ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
no it's unbound with no control source
 
The Control was working correctly
The Control now works correctly some of the time, then doesn't work correctly

This type of thing comes under what I call Strange, Odd and Curious Behavior, and S/O/C/B, especially when coupled with the phrase 'sometimes it does/sometimes it doesn't,' usually translates into corruption, in one form or another!

I'd try deleting then re-creating your Combobox. Controls, just like Forms and entire Databases, can and do become corrupted.

The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top