SetValue (1 Viewer)

D

Dell

Guest
I would like to have access automatically show me if I have printed an invoice. I have been experimenting in the order entry template that comes with access. It is similar to my invoice database. I would like to include a check box on the line of the subform for each invoice that automatically gets checked when I print that invoice. I have tried to add a check box field in the underlying table (orders) and then add it to the line in the subform. I then tried to use a macro in on activate property of invoice to setvalue of box to true. I have tried many different items and expressions for the setvalue macro and none of them work. Any ideas?
 

Carol

Registered User.
Local time
Today, 18:53
Joined
Jan 15, 2000
Messages
280
Create a checkbox called Printed within your underlying table and include this checkbox within your form. Attach a print command button called Print and in the On Enter of the command button, include this code:

Private Sub Print_Enter()
On Error GoTo Print_Enter_Err

Forms!MyFormName!Printed = True


Print_Enter_Exit:
Exit Sub

Print_Enter_Err:
MsgBox Error$
Resume Print_Enter_Exit

End Sub

On the same command button, you would set up a procedure to print the order using the On Click.

By using the above, when you set the order to print, the checkbox will evaluate to true and will be checked.

Good luck

[This message has been edited by Carol (edited 12-30-2000).]
 
D

Dell

Guest
Thanks for your help. I finally got it to work after many tries. I had to put the new field in a subform on the Orders by Customer form. When I included it in the other Orders by Customer subform it was not an updatable field. It turned out that it also works as a macros using SetValue like I had originally tried. Now I have to figure out how to make it select the correct orderID. If a customer has more than 1 order it only will check mark the first order. I need to connect my subforms somehow. It connects to my main form by CustomerID but the new subform does not recognize which order I'm printing.
 
D

Dell

Guest
I got it to work.
I used the On Current property to Open Form along with the Where condition to get everything to work together.
 

Users who are viewing this thread

Top Bottom