Access + Insert Into + confirmation dialog

  • Thread starter Thread starter Joseph Liu
  • Start date Start date
J

Joseph Liu

I am using MS Access 2003 with a DoCmd.RunSQL "Insert into ..." statement.
The statement executes perfectly but everytime when a record is inserted into
an Access table, I was prompted to confirm the insertion. Please advise where
I can eliminate this annoying prompt.

Thanks a lot.

Joseph
 
I am using MS Access 2003 with a DoCmd.RunSQL "Insert into ..." statement.
The statement executes perfectly but everytime when a record is inserted into
an Access table, I was prompted to confirm the insertion. Please advise where
I can eliminate this annoying prompt.

Thanks a lot.

Joseph

Rather than using RunSQL, use the Execute method:

On Error GoTo Proc_Error
<set up your insertion>
CurrentDb.Execute "Insert Into....", dbFailOnError
Proc_Exit:
Exit Sub
Proc_Error:
MsgBox "Error " & Err.Number " in insert function"
Resume Proc_Exit
End Sub

This will both avoid the warning message AND trap any query errors.
 
Back
Top