Recording Warnings In Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a procedure which performs various activities like running action
queries, executing TransferSpreadSheets and a few OutputTo commands. At the
begining of the procedure there is a DoCmd.SetWarnings False statement and
the end there is a DoCmd.SetWarnings True statement. Considering this
scenario I would want to keep track of warnings that might have been
generated between a:

DoCmd.SetWarnings False

and a

DoCmd.SetWarnings True

Please Suggest.

Thanks,

Pradeep
 
If you really want this, you should switch to DAO or ADO
actions, and use the RecordCount and RecordsAffected properties.

It will be more than twice as much work.

(david)
 
Hello David,

It is very interesting and would like to know how we could record warnings
with the RecordCount and the RecordsAffected properties.

Could you please explain it in detail so that I can try and see if the task
can be accomplished.

Thanks,

Pradeep
 
The warnings are generated partly from the RecordCount and
RecordsAffected properties.

For example, the warning 'this will update 5 records' is
generated from the Records Affected property.

If you wish to record that the update affected 5 records,
the only way is to use ADO or DAO, and record the RecordsAffected
property.

The warning '5 updates failed' is a kind of error message
that is not normally displayed. There may be a way to capture
these error messages, but I don't know about that. But you
can simulate that kind of error message by selecting the
records affected first, recording the RecordCount, then
running the update and recording the RecordsAffected.

(david)
 
David,

Like I said earlier, the procedure has numerous statements like Action
Queries, TransferSpreadSheet and OutputTo statements. Now I would not really
know which statement has caused the warning like:

Is it the TransferSpreadSheet
or
Is it the Action Query
Or
Is it the OutPutTo statement

In which I cannot really formulate the message and then append it with the
records affected property, if I understood your suggestion properly.

Thanks,

Pradeep
 
Is it the TransferSpreadSheet
or
Is it the Action Query
Or
Is it the OutPutTo statement

If you really want this, you should switch to DAO or ADO
actions, and use the RecordCount and RecordsAffected properties.

It will be more than twice as much work.

(david)
 

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

Back
Top