Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Query Error problem 2

Status
Not open for further replies.

SlakeB

MIS
Jun 15, 2005
40
US
Every time I run a macro of mine (which triggers a query) I get this error:

"Microsoft Access Can't Append All the Records in the Append Query"

It asks if I want to continue, and I click ok. Is there a way to keep this message box from popping up when this occurs? I've tried 'On Error Resume Next' and it didn't seem to work. The msg box still popped up and prompted me to press ok. Here is my code:

Code:
Private Sub Command17_Click()
On Error Resume Next


Dim stDocName As String

stDocName = "macBlake_macGenerateAndExportDailyWalkFiles"
DoCmd.RunMacro stDocName
    
stDocName = "macBlake_macClearAndUpdateFEOrderTableAndExport"
DoCmd.RunMacro stDocName
    
Exit_Command17_Click:
Exit Sub
    
End Sub
 
Have a look at the DoCmd.SetWarnings method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You could try using SetWarnings, e.g.
Code:
Private Sub Command17_Click()
On Error Resume Next

DoCmd.SetWarnings False
DoCmd.RunMacro "macBlake_macGenerateAndExportDailyWalkFiles"
DoCmd.RunMacro "macBlake_macClearAndUpdateFEOrderTableAndExport"
    
Exit_Command17_Click:
DoCmd.SetWarnings True
Exit Sub
    
End Sub
Hope this helps.

[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top