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!

CopyObject confirm replace message

Status
Not open for further replies.

kjpreston

Technical User
Jun 3, 2005
34
US
Hello All,
I'm trying to fix a piece of code that up till now worked just fine.
I have a public function that is suposed to copy a table in an access 2003 database and replace it. the problem is when it gets to the copy line I get a message that the table already exists and do I want to replace the existing table. the answer is Yes I always want to replace the existing table. Is there a way to program the "yes replace replace the existing table" so I don't have to answer the message each time?

Dim db As DAO.Database
Set db = CurrentDb
Dim xFname As Variant
xFname = Screen.ActiveForm.Name
DoCmd.Hourglass yes
DoCmd.CopyObject , "CRaw1", acTable, "CRawStructure"
DoCmd.CopyObject , "CRaw2", acTable, "CRawStructure"
DoCmd.CopyObject , "CRaw3", acTable, "CRawStructure
 
I'd use the DoCmd.SetWarnings method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Great! Thanks! That's simple enough, wish I had remembered the SetWarnings function, but Wednesday seemed to be a Monday this time. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top