Need help making error message

Nej

New member
Local time
Today, 09:59
Joined
Jul 15, 2002
Messages
8
Hello. Here is my situation...I'm making an "Process End of the Month Records" button on a switchboard page. The user will click on this button at the end of each the month to finish her monthly process. What I want it to do when the button is clicked on is:

1. Run a form that asks the user if they are sure they want to process the monthly records. If they click yes it goes to step 2. If no is clicked then it simply closes the form.

2. Run qrySetMonthProcessDate. Which sets the MonthProcessDate field to today's date on records marked as complete in the Worder table.

3. Run qryUpdateToolHist. Which copies all the records marked complete and with today's date to the ToolHist table.

4. Run qryDeleteWorder. Which deletes all the complete records with todays date out of the Worder table, leaving only the Pending work order records in the table.

I have all my queries built and working. But I would like an error message to stop the process if something goes wrong in one of the queries and show the user a message box saying there was an error. I'm relatively new to access and don't know an extensive amount of VBA but I'm willing to learn more. Any help anyone can offer would be great.

Thanks,

Nej
 
Your quickest start is the command button "wizard". When you drag a command button from the toolbox to a form, a dialog will start up. Select "Query operations" then "Run Query". You will be prompted for the name of a query. Select one of the queries you have created.

The wizard will create a Sub procedure with error handling code. You will need to repeat some lines to run additional queries.

RichM
 

Users who are viewing this thread

Back
Top Bottom