View Full Version : Append Query Help.


Nothingness
02-07-2007, 08:21 AM
Hello,
I've searched and read quite a few forum posts on how to append one query to another. I originally had a macro that I created which would open the Make Table Query and then open the Append Queries. I want to convert this to VBA and make it so I do not get those execute pop ups telling me how many rows were added. Any help would be greatly appreciated.

Below is the code that was created when I clicked the "Covernt Macros to Visual Basic" button:

Function Appending_Macro()
On Error GoTo Appending_Macro_Err
DoCmd.OpenQuery "200609 Append", acViewNormal, acEdit
DoCmd.OpenQuery "200610 Append", acViewNormal, acEdit
Appending_Macro_Exit:
Exit Function

Thank you again.

KenHigg
02-07-2007, 08:29 AM
If all you need is to make the messages go away then all you need to do is a setwarnings off. You can do this within a marco or with code...:)

Nothingness
02-07-2007, 09:04 AM
Thanks for the fast response! I've tried this but the one thing that I find discouraging about it is that I have no way of telling whether it was performed successfully--other than looking in the Table that was created and that is quite tedious.

I guess the better question would be, is there a command that tells me if all the records were successfully added?

I hate those warnings but they are nice because I know how many records were appended at least.

Thanks again.

KenHigg
02-07-2007, 09:55 AM
I find that simply displaying a message box saying the task is complete works well. :)

Dennisk
02-16-2007, 06:24 AM
you need to structure your procedure differently.

Procedure sum test()
on error goto Err_Handler

your code here

Exit_Handler:
'Clean up code here
Exit Sub

Err_Handler:
msgbox err & " " & err.Description
resume Exit_Handler
end sub

using this technique allows you set warning off but if an error occurs then the number and message will always be displayed.

Anthony George
02-20-2007, 12:11 PM
Hi

You could turn the reporting off manually:-

Click Tools
Click Options
Click Edit/Find Tab
Remove the tick from Action Queries

and that will suppress the annoying action query reports.

Regards

Tony