Error Handling in a query that was run from a macro (1 Viewer)

DrPat

Registered User.
Local time
Today, 06:23
Joined
Feb 7, 2011
Messages
39
(I'm not sure if this belongs in the macro or query forum)
I have a macro that opens 15 queries and ends with opening a report.

The final query asks the user to type in beginning date, then an end date. Now when there's a data mismatch (i.e., he spells feburary), the macro halts. No harm no foul, they can just click the command button again, but I'd rather not.

What I'd like to do is place a msgbox (i.e., "Check Your Spelling") and then reroute them back to the query.

Any suggestions?
 

boblarson

Smeghead
Local time
Today, 03:23
Joined
Jan 12, 2001
Messages
32,059
1. Use an input form for inputs. Don't use parameter prompts. If you just had a combo where they select the month, etc. it won't be incorrect ever.


2. What do these queries do? Are they make table queries, append, delete queries? If they are just select queries you don't need to open them for the report to run
 

DrPat

Registered User.
Local time
Today, 06:23
Joined
Feb 7, 2011
Messages
39
Thanks bob, that's a perfectly logical idea that's easy to execute.

All the queries are action queries, the one in question is a delete query that cuts away all data between the 2 dates.
 

Users who are viewing this thread

Top Bottom