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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ac07 error 2427 when ToggleFilter button pressed

Status
Not open for further replies.

hovercraft

Technical User
Jun 19, 2006
236
US
Greetings,

I'm getting error code 2427 "You entered an expression that has no value." (well it does to me!)
This error only happens when I use RunCommand, FilterByForm then enter my filter criteria and press the "Toggle Filter" button ... and there is no records matching.

I have no idea where to put the error handling code since it's generated from the Toggle Filter Button.
I've tried placing it under "Private Sub Form_Error(DataErr As Interger, Response As Interger)"
and I've tried it under "Private Sub Form_Filter(Cancel as etc...)"

The code I'm using is
Code:
Const conMyError = 2427
On Error goto myerror
myerror:
    If DataErr = conMyError Then
    Response = acDataErrContinue
    MsgBox "There are no Records"
end if
End Sub

Does anyone know where I should put the code? or if my code is just plain wrong. :)

Any help would be great, Thanks in advance!
Hovercraft
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top