Warning message in Access 2003

  • Thread starter Thread starter Colin
  • Start date Start date
C

Colin

In a switchboard form I'm using a make table query. This brings up a warning
message "The existing table ... will be deleted ... click yes to continue"

In the main drop down menu - Tools - Options - Edit/find - Confirm I have
all the tick boxes blank, which means I should not get this warning message.

I've searched the knowledgebase and can find no reference to this error.

Can anyone help please?

Thanks in anticipation, Colin
 
Colin said:
In a switchboard form I'm using a make table query. This brings up a
warning
message "The existing table ... will be deleted ... click yes to continue"

In the main drop down menu - Tools - Options - Edit/find - Confirm I have
all the tick boxes blank, which means I should not get this warning
message.

I've searched the knowledgebase and can find no reference to this error.

Can anyone help please?

Thanks in anticipation, Colin

DoCmd.SetWarnings False
' existing code
DoCmd.SetWarnings True
 
Stuart McCall said:
DoCmd.SetWarnings False
' existing code
DoCmd.SetWarnings True

I prefer, if DAO, to use Currentdb.Execute strSQL,dbfailonerror
command instead of docmd.runsql. For ADO use
CurrentProject.Connection.Execute strCommand, lngRecordsAffected,
adCmdText

If you're going to use docmd.setwarnings make very sure you put the
True statement in any error handling code as well. Otherwise weird
things may happen later on especially while you are working on the
app. For example you will no longer get the "Do you wish to save your
changes" message if you close an object. This may mean that unwanted
changes, deletions or additions will be saved to your MDB.

Also performance can be significantly different between the two
methods. One posting stated currentdb.execute took two seconds while
docmd.runsql took eight seconds. As always YMMV.

Tony

--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Tony Toews said:
I prefer, if DAO, to use Currentdb.Execute strSQL,dbfailonerror
command instead of docmd.runsql.

Me too. I was being lazy, not wanting to get into the why. I think you
covered it clearly & concisely. Thanks.
 
Back
Top