Stop error message

MikeyH

New member
Local time
Today, 13:11
Joined
Sep 26, 2008
Messages
1
Have a form to select a file and import data record from EXCEL and put in Access tbl. Have code installed to prevent importing a record already brought into Access. How do I block error msg telling me "Cannot add record..... etc." Don't know the code # for the error msg.
 
I am assuming you are using a query to do the import…To stop the error messages try this…

DoCmd.SetWarnings False ‘This turns the error messages off

DoCmd.OpenQuery "qryYourQryName", acViewNormal, acEdit 'This is your qry

DoCmd.SetWarnings True ‘This turns the error messages back on
 

Users who are viewing this thread

Back
Top Bottom