I use a custom dialouge box to take two parameters (postcode & storename) from a user to run a query report. It works fine, handels null responses and wildcard input (on the postcode), but for one thing. When a user puts in a postcode that doesn't exist (ie. there is no store of that name with a postcode like that) I get an error message 2427 you entered an expression without a value. Clicking debug highlights the first line of my page break counter for the report. As long as the postcode or partial postcode, provided by the user, exists for any given store then the report runs fine and the pagebreakes are in the correct place.
I have tried adding code to the error event of the report, but it doesn't work. Any ideas anyone?
Private Sub Report_Error(DataErr As Integer, Response As Integer)
MsgBox "There is no store with that postcode! Please try again!", vbOKOnly, "Error"
DoCmd.OpenForm "frmFindNear", acNormal, , , acFormEdit
End Sub
Many thanks
Jaydeebe BSC (hons) MCP
I have tried adding code to the error event of the report, but it doesn't work. Any ideas anyone?
Private Sub Report_Error(DataErr As Integer, Response As Integer)
MsgBox "There is no store with that postcode! Please try again!", vbOKOnly, "Error"
DoCmd.OpenForm "frmFindNear", acNormal, , , acFormEdit
End Sub
Many thanks
Jaydeebe BSC (hons) MCP