Turn off warnings but still print them to text file

B

Ben8765

Hi,

Is there a way to turn off the warnings, but still print them to a text
file(log)?

-Ben
 
D

Dirk Goldgar

Ben8765 said:
Hi,

Is there a way to turn off the warnings, but still print them to a text
file(log)?


You mean the warnings about "You are about to append/delete n records"? You
can't log that information without programming for it specially. If it's
information from executing action queries via RunSQL, you can use the DAO
execute method to run the query and immediately check the database object's
RecordsAffected property, and use your own code to write that information to
a log file. For example,

With CurrentDb

.Execute "DELETE FROM Table1 WHERE DateField<Date()", _
dbFailOnError

WriteLog "Deleted " & .RecordsAffected " records from Table1"

End With

If you want to log such activities when carried out via form operations, you
need to use special code to do that, too.
 
B

Ben8765

Thanks, a lot, i'll try this tomorrow.

-Ben

Dirk Goldgar said:
You mean the warnings about "You are about to append/delete n records"? You
can't log that information without programming for it specially. If it's
information from executing action queries via RunSQL, you can use the DAO
execute method to run the query and immediately check the database object's
RecordsAffected property, and use your own code to write that information to
a log file. For example,

With CurrentDb

.Execute "DELETE FROM Table1 WHERE DateField<Date()", _
dbFailOnError

WriteLog "Deleted " & .RecordsAffected " records from Table1"

End With

If you want to log such activities when carried out via form operations, you
need to use special code to do that, too.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 

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