Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-26-2004, 01:18 AM
paulcraigdainty paulcraigdainty is offline
Registered User
 
Join Date: Sep 2004
Location: Preston, United Kingdom.
Posts: 74
paulcraigdainty is on a distinguished road
Smile Stop standard Access messages

I want to stop standard Access messages prompting the user. For example When i run a delete query through a form the following is displayed: 'You are about to run a delete query that will modify data in your table'. My users don't understand what a table is and they don't need to. I want to disable this message so i can replace with my own prompt. Any help would be appreciated, thanks.
Reply With Quote
Sponsored Links
  #2  
Old 09-26-2004, 01:23 AM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
 
Join Date: May 2003
Location: Melbourne, Australia
Posts: 979
ansentry is on a distinguished road
I think this is what you want,

DoCmd.SetWarnings False

Run your query code here....


and don't forget!!


DoCmd.SetWarnings True

Regards,
__________________
Regards,



John A
Reply With Quote
  #3  
Old 09-26-2004, 03:25 AM
paulcraigdainty paulcraigdainty is offline
Registered User
 
Join Date: Sep 2004
Location: Preston, United Kingdom.
Posts: 74
paulcraigdainty is on a distinguished road
Thanks John that worked perfectly!
Reply With Quote
  #4  
Old 09-26-2004, 04:19 AM
Mile-O's Avatar
Mile-O Mile-O is offline
Administrator
 
Join Date: Dec 2002
Location: Glasgow, UK
Posts: 10,899
Mile-O is on a distinguished road
Just to expand on this. If you find that you are running a number of delete/append/update queries and want a slicker method then it may be an idea to create a function - this way you'll only have one piece of code that would need updated should you decide to edit anything.

i.e

Code:
Public Function ActionQuery(ByVal QueryName As String) As Boolean
    On Error Goto Err_ActionQuery
    With DoCmd
        .SetWarnings False
        .OpenQuery QueryName
        .SetWarnings True
    End With
    ActionQuery = True
    Exit Function
Err_ActionQuery:
    ActionQuery = False
End Function
Now, from your code you can call this by passing the name of the query you wish to run to it and have the added bonus of knowing whether the query was successful or not.

i.e.

Code:
If ActionQuery("MyQuery") = True Then
    MsgBox "Action was successful.", vbInformation
Else
    MsgBox "Unable to action query.", vbExclamation
End If
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:38 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World