Update checkbox after running a report

  • Thread starter Thread starter Serrum
  • Start date Start date
S

Serrum

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
 
Hi,

I think you just need to rethink your issue. Think of your it this way:

- Query (updatable, you can edit the data... the checkboxes)
- Report based on the Query
- You need to update the data in the Query NOT the Report

Thereby, you would have something like the following (assuming the data
printing is a record on your Form from where you are printing the Report
from):

DoCmd.OpenReport "Report Name"
Dim i As Integer

For i = 0 To Me.Count - 1
If TypeOf Me(i) Is acCheckBox Then
Me(i) = Yes
End If
Next i


Note: above loop routine extracted from
http://support.microsoft.com/default.aspx?scid=kb;en-us;210252

If you need to update ALL the records in the query then you could use
something like

Dim rst as DAO.Recordset
Set rst = Me.RecordsetClone
Do Until rst.EOF
rst!checkbox1 = Yes
rst!checkbox2 = Yes
rst!checkbox3 = Yes
rst.MoveNext
Loop

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights


--------------------
| From: "Serrum" <[email protected]>
| Newsgroups: microsoft.public.access.macros
| Subject: Update checkbox after running a report
| Lines: 18
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <ISddc.31038$Y%[email protected]>
| Date: Thu, 8 Apr 2004 16:04:32 +0100
| NNTP-Posting-Host: 212.159.78.126
| X-Complaints-To: (e-mail address removed)
| X-Trace: wards.force9.net 1081436712 212.159.78.126 (Thu, 08 Apr 2004
16:05:12 BST)
| NNTP-Posting-Date: Thu, 08 Apr 2004 16:05:12 BST
| Organization: Customer of PlusNet
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!newsfeed.wirehub.nl!landlord!wards.force9.net.POSTED!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.macros:31108
| X-Tomcat-NG: microsoft.public.access.macros
|
| 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
|
|
|
 
Back
Top