below is the code someone helped me with a while ago but i have now got a problem that
i would like to stop this give an error message if the address attached to the line number is not there in the table. i have discovered that people are not entering it and the reports are blank
So if i have an invoice for customer id no 149 the report will be ok but if i create another on say for customer id 150 . but there is no "address no" or information in the fields. i would like a message telling me
thanks
steve
i would like to stop this give an error message if the address attached to the line number is not there in the table. i have discovered that people are not entering it and the reports are blank
So if i have an invoice for customer id no 149 the report will be ok but if i create another on say for customer id 150 . but there is no "address no" or information in the fields. i would like a message telling me
thanks
steve
Code:
Private Sub cmdOpenInvoice_Click()
On Error GoTo Err_Handler
Const MESSAGE_TEXT = "No current invoice."
If Not IsNull([Invoice].[Form]![InvoiceNo]) Then
' ensure current record is saved
Me.Dirty = False
Me.addressno = InputBox("Please provide address line number")
' open report in print preview
DoCmd.OpenReport "Invoice report", View:=acViewPreview
Else
MsgBox MESSAGE_TEXT, vbExclamation, "Invalid Operation"
End If
Exit_Here:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Exit_Here
End Sub