Supress "Delete Table?" Warning

G

Guest

I have a Make-Table Query (QryUpdateBillingTable) that is run when the user
prints a Report (RptBillingList). It simply fills a table (TblBillingList)
with the Order Numbers (OrderNo) from that report so that I can update those
records with an Update Query at a later time (Once the user verifies the info
is correct).

My concern is that when the Make-Table Query is run, it prompts the user
with "The existing table 'TblBillingList' will be deleted before you run the
query. Do you want to continue anyway? Yes / No".

Can I supress, avoid, or hide this warning from the user?

Is there a way to auto-answer this prompt through coding?

Or is there a better way to clear the table and populate it with the correct
info?

I'm using Access 2000.

Thanks in advance for any help!

Parker
 
W

Wayne Morgan

Is the table structure the same every time? If so, just run a Delete query
to delete the data from the table then run an Append query to add the new
data to it, leaving the table in place. Another option is to delete the
table first then run your Make Table query. This will create an error if the
table doesn't exist and you try to delete it, but this can simply be trapped
in the code's error handler.
 
D

Dave Patrick

As Wayne says use the delete query if you can. If not then just before;

DoCmd.SetWarnings False

then immediately after

DoCmd.SetWarnings True



--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
|I have a Make-Table Query (QryUpdateBillingTable) that is run when the user
| prints a Report (RptBillingList). It simply fills a table
(TblBillingList)
| with the Order Numbers (OrderNo) from that report so that I can update
those
| records with an Update Query at a later time (Once the user verifies the
info
| is correct).
|
| My concern is that when the Make-Table Query is run, it prompts the user
| with "The existing table 'TblBillingList' will be deleted before you run
the
| query. Do you want to continue anyway? Yes / No".
|
| Can I supress, avoid, or hide this warning from the user?
|
| Is there a way to auto-answer this prompt through coding?
|
| Or is there a better way to clear the table and populate it with the
correct
| info?
|
| I'm using Access 2000.
|
| Thanks in advance for any help!
|
| Parker
 
T

Tim Ferguson

Or is there a better way to clear the table and populate it with the
correct info?

Just to clarify what Wayne is suggesting:

' just about the simplest SQL statement there is!
strSQL = "DELETE FROM tblBillingList"

' using .Execute does not raise any warnings about deleted
' rows; and using dbFailOnError raised a vba error if something
' goes wrong, such as forgetting to Set db = something...
db.Execute strSQL, dbFailOnError

' repopulate the table with an append query rather than a
' make table one. The advantage is that any indexes and the
' PK that you set on tblBillingList will be kept, which does not
' happen with a maketable.
strSQL = "SELECT somevalues INTO tblBillingList " & _
"FROM Somewhere ETC"

' see above
db.Execute strSQL, dbFailOnError


Hope that helps


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top