Maybe Update Query

  • Thread starter Thread starter vel
  • Start date Start date
V

vel

Hello,

I'm not sure if an update query is the way to go, but
here's my question.

I have a table, tblActivity, which contains activities to
be billed.

In this table is a date/time field [PrintedOn]

I have a report which prints out billing forms for all
records whose [PrintedOn] value = Null.

What I would like is when the report is actually printed
(not just viewed) to fire an update query which would
update the null [PrintedOn] values to =Now()

I'm not particularly well versed in the usage of update
queries, and could use some help in how this should look
in the query window. I was also wondering where I should
put the code to open said query in the report so it only
fires when the report is actually printed out.

Thanks Again,

Vel
 
What I would like is when the report is actually printed
(not just viewed) to fire an update query which would
update the null [PrintedOn] values to =Now()

An Update query will do this... BUT!

Access has no way to determine whether the report has been printed
*successfully*. The printer might jam; the toner might have run out;
all sorts of things can happen after the file has been sent to the
printer driver.

What you might want to do is have code in the Report's Close event to
ask the user if it was printed; if they say yes just run the Update
query. E.g.

Dim iAns As Integer
iAns = MsgBox("Did it print correctly?", vbYesNo)
If iAns = vbYes Then
DoCmd.RunSQL "UPDATE [yourtable] SET [PrintedOn] = Now();"
End If
 
Back
Top