Error handling

tezread

Registered User.
Local time
Today, 06:54
Joined
Jan 26, 2010
Messages
330
I have a reporting tool that requires the user to enter a start and end date. At the moment if either date is not entered - the error message:

The MS jet engine does not recognise " as a valid field or expression.

Is there any way I can over ride this message and create my own
 
You are better off fixing the syntax than trying to camouflage the error.

One way of getting rid of the problem is to build the sql in code. So you check for Null and zls.

Or use the LIKE operator with an IIF() function. But this method is less effecient.
 
You are better off fixing the syntax than trying to camouflage the error.

One way of getting rid of the problem is to build the sql in code. So you check for Null and zls.

Or use the LIKE operator with an IIF() function. But this method is less effecient.

The report is run using a cross tab query so what you are suggesting is basically have that query run using VBA. I am not confident on VBA but want to learn. Can you signpost to a beginners thread you know of about running SQL queries and error handling using VBA?
I don;t want to be spoon fed - that is too easy
 

Users who are viewing this thread

Back
Top Bottom