Private Sub Form_BeforePrint (Device As fdPrintDevice, Cancel As Boolean) '----------------------------------------------------------- 'This is an example of manipulating data in the FormDocs form 'prior to printing the selected page. ' 'Notes: 'Thisform is an object of type Form that refers To the currnet form. 'The "Fields" collection refers to all the fields on a form page. '----------------------------------------------------------- Dim lcField As Field 'Declare field object work variable Dim lcWork As String 'Declare work variable to hold field in string format '----------------------------------------------------------- 'Display a specific Message for one of the form fields '----------------------------------------------------------- 'Msgbox Thisform.Fields("InvoiceNo").Value '----------------------------------------------------------- 'Iterate through all fields and display '----------------------------------------------------------- 'For Each lcField In Thisform.Fields ' MsgBox lcField.Name & lcField.Value 'Next '----------------------------------------------------------- 'Move invoice number to string field '----------------------------------------------------------- 'lcWork = Thisform.Fields("InvoiceNo").Value '----------------------------------------------------------- 'Place the prefix INV: in front of the invoice number 'and modify the form values. '----------------------------------------------------------- Thisform.Fields("InvoiceNo").Value = "INV:" & Thisform.Fields("InvoiceNo").Value End Sub
Still have questions? We can help. Submit a case to Technical Support.