L
lcox400w
I am trying to write code, but having trouble with one part. When my form
opens, I want to run some code to see if there are any missing/mandatory
fields and if so I am going ot highlight them and advise the user to complete
them. I am using select case which will list the various control source
names but its not working properly. I have tried several variations of the
below, but I'm apperantly not grabbing the correct name to ID the control
source so I can check it to see if it has data in it and then take some
action. I'm sure this is pretty simple, but I'm stuck. Anyone out there who
can help would be appreciated. These are a few of the variations I have
tried:
Select Case ControlSource
Select Case Me.ControlSource
Select Case Me.Name
Case "CaseType"
If Not IsNull(CaseType) Then
'Add code to highlight the field
End If
Case "DateOccd"
If Not IsNull(DateOccd) Then
'Add code to highlight the field
Else
End If
End Select
opens, I want to run some code to see if there are any missing/mandatory
fields and if so I am going ot highlight them and advise the user to complete
them. I am using select case which will list the various control source
names but its not working properly. I have tried several variations of the
below, but I'm apperantly not grabbing the correct name to ID the control
source so I can check it to see if it has data in it and then take some
action. I'm sure this is pretty simple, but I'm stuck. Anyone out there who
can help would be appreciated. These are a few of the variations I have
tried:
Select Case ControlSource
Select Case Me.ControlSource
Select Case Me.Name
Case "CaseType"
If Not IsNull(CaseType) Then
'Add code to highlight the field
End If
Case "DateOccd"
If Not IsNull(DateOccd) Then
'Add code to highlight the field
Else
End If
End Select