| Chat with a LIVE Microsoft
Access Expert! |
||||
|
||||
|
#1
|
|||
|
|||
|
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.
|
| Sponsored Links |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
Thanks John that worked perfectly!
![]() |
|
#4
|
||||
|
||||
|
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
i.e. Code:
If ActionQuery("MyQuery") = True Then
MsgBox "Action was successful.", vbInformation
Else
MsgBox "Unable to action query.", vbExclamation
End If
|
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|