The code I'm working with is below, I only want to check that some data is entered into any field of a subform. Maybe recordset should be used?
It seems to skip past this causing no error where there should be one:
Code:
If IsNull(Me.Invoice_Generator2.Form.Controls(Inv_Quantity)) = True Then
Full code listed below. The date validation works ok.
Code:
Private Sub Command4_Click()
On Error GoTo HandleError
'''''''''''''
If IsNull(Me.Invoice_Generator2.Form.Controls(Inv_Quantity)) = True Then
MsgBox "Enter at least 1 line value."
Exit Sub
Else
End If
'''''''''''''
If IsNull(Date_on_invoicetxt) = True Then
MsgBox "Please enter a date for the invoice."
Exit Sub
Else
End If
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenQuery "append invoice lines"
DoCmd.OpenQuery "Update_invoice_issue"
DoCmd.Close acForm, "New Invoice", acSaveYes
DoCmd.SetWarnings True
HandleExit:
Exit Sub
HandleError:
MsgBox Err.Description
Resume HandleExit
End Sub
any help appreciated. its probably simple but I'm very rusty.