Errant message box (1 Viewer)

jrjr

A work in progress
Local time
Yesterday, 23:11
Joined
Jul 23, 2004
Messages
291
In the onchange event of a combo I have this code:

Me.Form.Requery
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "Sorry, no records meet your chosen criteria", , "Notice!"
End If

This is used in several different DB's and has been working well. All of a sudden one of them has started displaying the messagebox even when there are records returned.

I checked my backup .mdb and it does it there too. The .mde that I have saved does not do this however, just the .mde that is in use on the server.

All of the other DB's with the same code are fine, just this one on the server and my saved .mdb. Actually, this DB is not in use just yet, it is just sitting there waiting for some action..... I was checking things and discovered the trouble today.

If anyone has a suggestion what to check or look for.....
I have already checked the code and it is unchanged.
 

RuralGuy

AWF VIP
Local time
Yesterday, 21:11
Joined
Jul 2, 2005
Messages
13,826
I don't know the priority of the RecordSetClone but I know it is not as high as the RecordSet. Since you are only looking at the RecordCount then why not use the actual RecordSet.RecordCount?
 

jrjr

A work in progress
Local time
Yesterday, 23:11
Joined
Jul 23, 2004
Messages
291
Guess I should have elaborated more. The RecordsetClone is used for a listbox. This is when it is was happening.... when I change the combo's value, the listbox is filtered on the new entry in the combo.

I have it sorted I believe. I relinked the tables and it seems to be working ok now. Strange
 

Users who are viewing this thread

Top Bottom