[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

I need to hide the display message box

Posted on 2009-04-15
16
Medium Priority
?
452 Views
Last Modified: 2013-11-28
I have created the forms and I created a delete action query and attched that delete action query to close function of the form, so when i close the "angle blank form" it gives me a message box stating"you are about to delete query that will modify your table", i really do not want to pop up this message everytime i close the form. I need a suggestion for this. I tried by going to office button and unchecked the action queries button, but i do not want this solution. I there is any other solution by doing  this is by using macro, I prefer that.

I have attached the access database.
Database3.mdb
0
Comment
Question by:jpeterjeyaraj
  • 7
  • 5
  • 4
16 Comments
 
LVL 15

Expert Comment

by:MNelson831
ID: 24150307
Click the office logo in the upper left hand corner of Access. Then click Access options-->advanced and scroll down to CONFIRM and deselect the check boxes.
0
 
LVL 15

Expert Comment

by:MNelson831
ID: 24150313
Programatically you can use this:

DoCmd.SetWarnings False

before your action and then

DoCmd.SetWarnings True

after your action
0
 

Author Comment

by:jpeterjeyaraj
ID: 24150375
can you please tell me where in the form to use the above code. thanks
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:MNelson831
ID: 24150409
In the VBA code.  If the event thattriggers the action is on a button then open the form in design view, right click on the button and open the properties page.  On the events tab there will be a click event that should be set to [event procedure]. Click the ellipses (...) next to that to open the code.  Somewhere in the code there will be a command to run a query or execute an SQL statement.
0
 
LVL 15

Expert Comment

by:MNelson831
ID: 24150433
OK, which form in your database are we talking about?
0
 
LVL 75
ID: 24150547
Let me suggest a safer way to do this.  Put the following code in the On Unload event (instead of On Close) - which will end up looking like this:

Private Sub Form_UnLoad(Cancel As Integer)

CurrentDb.Execute "YourDeleteQueryName", dbFailOnError.

End Sub

This prevents the 'normal' prompt about 'You are about to .... yada yada" .... however, IF ... some other actual error should occur, the dbFailOnError will catch it.  

The problem with SetWarnings False is ... it masks ALL errors ... which can lead to you thinking ... that every thing completely correctly ... when it may have not.

mx
0
 

Author Comment

by:jpeterjeyaraj
ID: 24150627
Mnelson31,
we are talking about the database i have sent, in that open angle blank form.

DatabaseMX, the code is not working can you please ealaborat to me in detail, i am a new user, thanks
0
 
LVL 75
ID: 24150664
"the code is not working "

Can you post exactly what you have.  Not sure I can elaborate any more than I did ... there is just one line of code you need ... and I explained why ...

mx
0
 

Author Comment

by:jpeterjeyaraj
ID: 24150751
DID THIS IS IN ON UNLOAD FORM, IT GIVES ME A COMPILE ERROR,
EXPECTED IDENTIFIER OR BRACKETED EXPRESSION
THANKS
0
 
LVL 75
ID: 24150780
Please post the code ... and please do not type in all CAPS.

mx
0
 

Author Comment

by:jpeterjeyaraj
ID: 24150863
ok, sorry for that i did th same thing
Private Sub Form_UnLoad(Cancel As Integer)
CurrentDb.Execute "angle blank table query", dbFailOnError.
End Sub

it gives me compile error "expected identifie or bracketed expression"
thanks
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 24150892
Remove the period (.) after dbFailOnError  

CurrentDb.Execute "angle blank table query", dbFailOnError.
                                                                                               ^

mx
0
 

Author Comment

by:jpeterjeyaraj
ID: 24150914
it worked thanks a lot
0
 

Author Comment

by:jpeterjeyaraj
ID: 24151928
with reference to the above subject, for instance if two people are working on same database and tries to send an mail to me and anothe person is trying to enter new record by that time the first person send the mail and when he closes, the data will be lost whatever the second person has entered right, so the second would have mailled only the blank form to me. Right can you please suggest how to go abut this issue, if you can open my datbase, youcan see that
thanks in advance
0
 
LVL 75
ID: 24151969
I believe this is a new question.  Can you assign points and then close this question and re-post the new Q.

thx
0
 

Author Closing Comment

by:jpeterjeyaraj
ID: 31570577
It was verygood thanks to Mx and Mnelson831
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question