If Statement Help Needed

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

Dave

I have a main form Named TimeCards with a sub-form on it named
FTimeBillingSub
on the sub-form there is a control named BillPer
If this control isnull ,then I need a message box to show the below.
I tried the code below, but of course it didn't work.


If IsNull "Forms!FTimeBillingSub!BillPer Then
MsgBox "Job Has Not Been Invoiced Yet"
End If
 
A subform is actually a control on the Form object of your main form. Try
referencing it this way:

Forms!TimeCards.Form!FTimeBillingSub!BillPer
 
I have a main form Named TimeCards with a sub-form on it named
FTimeBillingSub
on the sub-form there is a control named BillPer
If this control isnull ,then I need a message box to show the below.
I tried the code below, but of course it didn't work.


If IsNull "Forms!FTimeBillingSub!BillPer Then
MsgBox "Job Has Not Been Invoiced Yet"
End If
Try this...

If IsNull ("Forms!FTimeBillingSub!BillPer") Then
MsgBox "Job Has Not Been Invoiced Yet"
End If

- Jim
 
Ok, that worked , but trying to make it also use a second criteria also.
If Is Not Null StartDte as second criteria, but it does not work with the
added criteria?

If IsNull(Text362) And IfNot Is Null (StartDte) Then
DoCmd.RunMacro "macropopup"

'MsgBox "Job Has Not Been Invoiced"
End If
 
Need also second If Condition to work, tried this code below, but with no
success.

If IsNull(Text362) And (StartDte) Is Not Null Then
DoCmd.RunMacro "macropopup"

End If
 
How about,

If (IsNull(Text362) And Not IsNull(StartDte)) then
DoCmd.RunMacro "macropopup"
End If

grep
 
IsNull(X) returns either True or False. So test for that.


If IsNull(Text362) = True And IsNull(StartDte) = False Then
DoCmd.RunMacro "macropopup"

End If
 
Ok, that worked , but trying to make it also use a second criteria also.
If Is Not Null StartDte as second criteria, but it does not work with the
added criteria?

If IsNull(Text362) And IfNot Is Null (StartDte) Then
DoCmd.RunMacro "macropopup"

'MsgBox "Job Has Not Been Invoiced"
End If

The If Condition part should only have an If at the start...

If IsNull(Text362) And Not IsNull (StartDte) Then


[also you had an error in the second IsNull]

- Jim
 
Back
Top