B
Bob Quintal
I am trying to disable some controls on a form when it opens using
this Load event but it is not working. Is there something I am
doing wrong. I even tried using .Visible and that didn't work
either. Can someone please tell me what I am doing wrong. Thank
you.
You are trying to compare field values to null. Null does not =
Null, What you want to do is test to see if the fields are null
using the isnull function.
If isNull(Me.txtVendor.Value) Then
If isNull(Me.txtReviewer.Value) Then
etc.
Private Sub Form_Load()
If Me.txtVendor.Value = Null Then
Me.txtVendor.Enabled = False
End If
If Me.txtReviewer.Value = Null Then
Me.txtReviewer.Enabled = False
End If
If Me.txtBeginDateRange.Value = Null Then
Me.txtBeginDateRange.Enabled = False
'Me.lblSDR.Enabled = False
End If
If Me.txtEndDateRange.Value = Null Then
Me.txtEndDateRange.Enabled = False
'Me.lblEDR.Enabled = False
End If
If Me.txtSingleDate.Value = Null Then
Me.txtSingleDate.Enabled = False
'me.lblSingleDate.Enabled = False
End If
End Sub