Warning Message

aftabn10

Registered User.
Local time
Today, 18:54
Joined
Nov 4, 2008
Messages
96
Hi, I have created a query to add some data into an existing table.

To automate this I have created a macro to run this query when required, however what I would like to do is to add a warning message "Are you sure you want to add new data" but i am not sure how to do that.

The reason being is that if somebody clicks the add data button in error, then this will mess the tables up.

If somebody could please help.

Thanks in advance.
 
For the button on your form that runs the update query..
Code:
If msgbox "Do you want to continue", vbyesno = vbyes then
  'Run your command here
else
exit sub
endif
 
I don't really use macros but you can achieve this easily using VBA. If I remember rightly you know some VBA?
 
Thats rite, I do. Using Access 2007, which has the Actions and Conditions and was wondering if there was a way to write the query within their?

Access_guy49 thanks for your reply, will try that out...
 
Remember to enclose the msgbox paramter in brackets (using Accessguy49's code):
Code:
If msgbox("Do you want to continue", vbyesno, "Insert confirmation") = vbyes then
       'Run your command here
else
        Msgbox "Action cancelled"
end if
No need to exit sub. You can decide whether or not to include the Else statement.
 
I use a macro condition to ask the use if the user has loaded headed paper. this bit goes in the condition box of the top action and any other actions below that should be condition ...

Msgbox('Haeded paper loaded?',1)=1
...
...

hope this helps
 

Users who are viewing this thread

Back
Top Bottom