Hi,
Is this in code? By amend, do you mean append or update? It is not
really a boolean. You have to get at it through the use of error handling.
And you have to deal with several possible responses. Use the On Error
Resume Next statement along with the Err object. Here is a sample for an
append query.
Public Sub ActionQuery()
Dim lngErrorNumber As Long
Dim strErrorDescription As String
On Error GoTo Handle_Error
' Some code
' Stop using the regular error handler
On Error Resume Next
DoCmd.OpenQuery "QueryX"
' Save the current error information for later use
lngErrorNumber = Err.Number
strErrorDescription = Err.Description
' Resume using the regular error handler
On Error GoTo Handle_Error
If lngErrorNumber = 2001 Or lngErrorNumber = 2501 Or lngErrorNumber =
3059 Then
' 2001 - User cancelled the parameter box of a query which has
parameters
' 2501 - User chose No to "You are about to run an append query..."
' 2501 - For queries without parameters: User chose No to "You are
about to append..."
' 3059 - For queries with parameters: User chose No to "You are
about to append..."
' Code when user stopped query
Else
If lngErrorNumber <> 0 Then
' Some other error; re-raise the error so the regular error
handler will take care
' of it
Err.Raise lngErrorNumber, , strErrorDescription
End If
' Code when user did not stop the query
End If
' Other code
Exit_Sub:
Exit Sub
Handle_Error:
MsgBox Err.Number & ": " & Err.Description
Resume Exit_Sub
End Sub
An update query may return some other error values so you may need to
discover those and then code for them.
Hope this helps,
Clifford Bass