Re: Catch errors on append query
From: Graham R Seach (gseach_at_NOSPAMpacificdb.com.au)
Date: 05/28/04
- Next message: Brian Kastel: "Re: IIF Limitation"
- Previous message: Mark White: "Re: Incrementing a month value"
- In reply to: Bruce: "Re: Catch errors on append query"
- Next in thread: Bruce: "Re: Catch errors on append query"
- Reply: Bruce: "Re: Catch errors on append query"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 28 May 2004 12:38:59 +1000
Bruce,
If the IF statement is true, then there MUST be an error. Change your code
as follows, and let me know what the result is:
CurrentDb.Execute "qry_Append_LTD", dbFailOnError
MsgBox (Err)
If Err <> 0 Then
MsgBox Err.Number & vbCrlf & Err.Description
Else
MsgBox "PAF has been saved successfully"
End If
If this doesn't show anything useful, it might be time to send me the
database so I can take a look. I'm working in the dark here, because I don't
have your table structure, data, and queries to test.
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
"Bruce" <anonymous@discussions.microsoft.com> wrote in message
news:3DBD106B-8981-4AFB-8053-31B187A060FA@microsoft.com...
> Bruce,
>
> No error code. When I step through the following the if statement is true.
> i.e. "The record could not be added."
>
> when i run "qry_Append_LTD" by open query rather than execute its ok. I am
totally puzzled....
>
> CurrentDb.Execute "qry_Append_LTD", dbFailOnError
> MsgBox (Err)
> If Err <> 0 Then
> MsgBox "The record could not be added."
> Else
> MsgBox "PAF has been saved successfully"
> End If
>
- Next message: Brian Kastel: "Re: IIF Limitation"
- Previous message: Mark White: "Re: Incrementing a month value"
- In reply to: Bruce: "Re: Catch errors on append query"
- Next in thread: Bruce: "Re: Catch errors on append query"
- Reply: Bruce: "Re: Catch errors on append query"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|