>Hi all,
>
>I want to count the amount of printing an invoice and save it to a field.
>Users can preview the invoice first then print it or directly print the invoice
>without preview first.
>
>The problem is how could I save it to a field with two conditions above ?
>I appreciate for any help.
>
>TIA,
>
>Budianto
Create a Page Summary band (it can be a zero height) and call a UDF in the On Exit option. In the UDF, do something like:
LOCAL lcAlias
lcAlias = ALIAS()
SELECT InvoiceHeader
REPLACE PrintCount WITH PrintCount + 1
SELECT (lcAlias)
If you only want to increment the count when the user "Prints" and not when they "preview", change the code as follows:
IF WEXIST('Printing...')
LOCAL lcAlias
lcAlias = ALIAS()
SELECT InvoiceHeader
REPLACE PrintCount WITH PrintCount + 1
SELECT (lcAlias)
ENDIF
Hope this helps,
Cathy