Changing Field values after a report is printed

T

TimJames

I have a form that is filled out by a user for deliveries, one product per
entry. The users may create several entries for different products for
delivery to various areas. After the form is filled out a button is clicked
that generates a report to print out for obtaining signatures for delivery.
Is there a way to also change the value of a field in my table to indicate
that the delivery / form has been printed? I need this as sometimes a second
delivery for that day may be needed and I do not want the deliveries that
have already been made to be printed again.

Thank you,
~Tim
 
T

Tom van Stiphout

On Fri, 29 Jan 2010 12:39:01 -0800, TimJames

Sure. You can ask the user:
if Msgbox("Print OK?", vbYesNo or vbQuestion) = vbYes then
'TODO: Run update query
end if
Perhaps this code could be in the Report_Close event.

The details will depend on the exact circumstances of your app.

-Tom.
Microsoft Access MVP
 
D

Daryl S

Tim -

You can update the field when the user clicks the button to print. If the
field is not on the form, add it (you can make it not visible if you don't
want the users to see it). Then in the code behind the Click event of the
print button, add something like this (use your control name):

Me.DeliveryPrinted = True
Me.Dirty = False ' to save the record.
 

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