IF Statement Wont Work, See Code Below, Thanks in Advance

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

I have a main form with 3 sub-forms on it. Main form name is Employees. My
Code does not work.
1st sub-form is TPayRate Control is PayRate
2nd sub-form is TNoAllow Control is NoAllow
3rd sub-form is TSinMar Control is SinMar
These fields need info in them or else can't save record, MsgBox

Thanks,

Dave





If IsNull(Forms![Employees]![TPayRate].Form!PayRate) Then
MsgBox "Employee Pay Rate Needed Please"
Cancel = True
End If
If IsNull(Forms![Employees]![FNoAllowSub].Form!NoAllow) Then
MsgBox "Choose Number of Dependants Please"
Cancel = True
End If
If IsNull(Forms![Employees]![TSinMar].Form!SinMar) Then
MsgBox "Is Employee Single or Married ?"
Cancel = True
End If
 
Dave,
I have a main form with 3 sub-forms on it. Main form name is Employees. My
Code does not work.
1st sub-form is TPayRate Control is PayRate
2nd sub-form is TNoAllow Control is NoAllow
3rd sub-form is TSinMar Control is SinMar
These fields need info in them or else can't save record, MsgBox

If IsNull(Forms![Employees]![TPayRate].Form!PayRate) Then

If Nz(Forms![Employees]![TPayRate]!PayRate,"")="" Then

(Same for others)

HTH - Peter
 
Back
Top