I have found a ton of requests for this issue online but none of them seem to work.
I am simply trying to lock a field after the user inputs a date into a field on my form. Below is some code I found from another thread from years ago that seemed to work for the person that requested it but its not working for me.
Can anyone see any errors in this code? The first part works fine but the second part turns red when I'm in VBA. It highlights "Overall" specifically.
Any help would be greatly appreciated Thank you!
I am simply trying to lock a field after the user inputs a date into a field on my form. Below is some code I found from another thread from years ago that seemed to work for the person that requested it but its not working for me.
Can anyone see any errors in this code? The first part works fine but the second part turns red when I'm in VBA. It highlights "Overall" specifically.
Any help would be greatly appreciated Thank you!
Code:
Private Sub Form_Current()
If Nz(Me![Deployment Date], "") = "" Then
Me!archivehotelsmacro.Visible = False
Else
Me!archivehotelsmacro.Visible = True
End If
'******BELOW THIS AREA DOESN'T WORK*********
Dim bolBaselineDate As Boolean
bolBaselineDate = IIf(Nz(Me![Old Overall Rank Postion], "") = "", False, True)
If bolBaselineDate = True Then
Me.Combo565.SetFocus
Me!Old Overall Rank Postion.Enabled = False
Me!Old Overall Rank Postion.Locked = True
Else
Me!Old Overall Rank Postion.Enabled = True
Me!Old Overall Rank Postion.Locked = False
End If
End Sub