Re: Ridding myself of "You are about to add n records to a New Table"

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Another approach is:
dbEngine(0)(0).Execute strSql, dbFailOnError

That has the advantage of notifying you if something goes wrong, but not if
the action completes successfully.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"xRoachx" <xRoachx@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:024ABA6C-FB40-4FED-9547-9E94996DE064@xxxxxxxxxxxxxxxx
> Before your SQL execution, enter the line:
>
> DoCmd.SetWarnings False
>
> Before you exit the function:
>
> DoCmd.SetWarnings True
>
> Always make sure to turn the warnings back on.
>
> "Neily" wrote:
>
>> Hi,
>>
>> I've got a bit of VB code that runs a few DoCmd's. It currently runs an
>> SQL
>> that takes a section of data from one table and writes it to a new table.
>> When this section runs, it the default message warning you what you are
>> about
>> to do comes up.
>>
>> Is there any way, programattically or otherwise to stop this message
>> coming
>> up so that the code runs straight through with no messageboxes?
>>
>> Ta..


.