Private Sub Form_Current()
If IsNull(Me.TextBoxName) Then
TextBoxName.Locked = False
Else
TextBoxName.Locked = True
End If
End Sub
Let me try to rephraseDon't have time to experiment, right now (sorry) but you're correct...the Locked and Enabled Properties only apply to physically interacting with a Control...and don't apply when populating a Control via code, as you're doing.
But to be honest, it's hard to understand why if the Control's Value depends on another Control's Value once...why it shouldn't depend on it when the second Control is edited.
Perhaps a clearer explanation of this would help up help you.
Linq ;0)>
If Nz(Me.BookingRef,"") = "" Then
Me.BookingRef = Me.BookingNr
End If
quite true. We cannot assume that complete record would be entered in one go!That would assume that the entire Record was entered when the Record was first initiated...which is not always the case. Users sometimes stop mid-Record to visit the loo...go to lunch... (gasp) take a smoke!
Linq ;0)>
correctThe point isn't to prevent physically changing the Control's Value. The point is that the Control is populated the first time a second Control has data entered...but if that second Control is later edited, the original Control's Value doesn't change.
If Me.NewRecord Then
'' your code goes here
End If