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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating checkboxes after running a report

Status
Not open for further replies.

JDSSerrum

IS-IT--Management
Nov 1, 2002
5
GB
Please help!,

I am trying to update a checkbox - called 'invoiced' after a report (Used to
generate an Invoice) has run.

I have tried putting the macro on both 'on close' and 'on open' but it fails
all the time, (I presume becasue it is happening to early or late). The
macro expression is correct I have tested it on a form with a button.

Essentialy I would like it to autmatically mark customer support logs as
invoiced once the report has run. The invoice report is built from a query
and contains many 'support logs' thus the macro needs to change the value of
all the 'support logs' on the report.

Am I going about this in the wrong manner, where should I place the macro
event. Any help would be great! thanks for your time
 
Assuming that the relevant data is not continually changing then use the report recordsource as the basis of an update query to update the relevant records, once the report is printed to your satisfaction.
If you make it automatic you risk the report not completing due to a printer wreck or any other reason, and updating erroneously.
But of course it's your app.


 
Thanks for your help, but am a bit confused? A detaild account of what I am trying to achieve:

A report is generated from a query only showing 'support' not invoiced.
This becomes the invoice for the customer.
Instead of manualy changing all the 'Invoiced' checkbox's in the 'support' table.
Can a macro do this automatically once the 'Invoice' Report has been run - (The report is outputed to acrobat writer)

Thanks and please excuse the ignorance?
 
If the report is based on a query such as:
Select * from mytable where Invoiced = false

Then you want to create an update query which is:
Update mytable set Invoiced = true Where Invoiced = false

You could run this query from the Close event of the report, provided there are no circumstances EVER that you would not want it to run. Alternatively run the query from a button placed alongside the one which runs the report.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top