Hi Guyz
Can anyone help me out. For some unknown reason I cannot execute an If statement which should check a field to see if it is empty.
I have a 3 Unbound Text Boxes, TxtStartDate , TxtEndDate, TxtTitle.
They are where the operator put the parameters for a bunch of reports.
The operator clicks on the Print Report Button and the following code should run.
If (Len(TxtEndDate) = 0) Or (Len(Me.TxtStartDate) = 0) Or (Len(Me.TxtTitle) = 0)
MsgBox "You must enter a Start Date, End Date and Title for the Reports", vbCritical
Else
If Me.SCARFOutstanding = -1 Then
DoCmd.OpenReport "SCARFS Outstanding"
End If
End If
This won't work. I have also tried Me.TxtStartDate = "" and
Nz(Me.TxtStartDate, ""
= ""
These won't work either. I don't know why but it seems so simple to me. I've done this loads of times before.
Lloyd Gozzett
Process Developer
Can anyone help me out. For some unknown reason I cannot execute an If statement which should check a field to see if it is empty.
I have a 3 Unbound Text Boxes, TxtStartDate , TxtEndDate, TxtTitle.
They are where the operator put the parameters for a bunch of reports.
The operator clicks on the Print Report Button and the following code should run.
If (Len(TxtEndDate) = 0) Or (Len(Me.TxtStartDate) = 0) Or (Len(Me.TxtTitle) = 0)
MsgBox "You must enter a Start Date, End Date and Title for the Reports", vbCritical
Else
If Me.SCARFOutstanding = -1 Then
DoCmd.OpenReport "SCARFS Outstanding"
End If
End If
This won't work. I have also tried Me.TxtStartDate = "" and
Nz(Me.TxtStartDate, ""
These won't work either. I don't know why but it seems so simple to me. I've done this loads of times before.
Lloyd Gozzett
Process Developer