Hello,
I have a combo box [PHIconsultantco mbo] on a form that I would like to 'lock' the selection of after the user makes a selection, then either moves to the next record or saves the form. This selection will therefore be unable to be changed afterwards.
From my research, I'm assuming that the following code needs to be placed into form_current event somehow:
My current form_current event code looks like this:
How do I add the lostfocus code to the current event form code? Or am I on completely the wrong track?
I have a combo box [PHIconsultantco mbo] on a form that I would like to 'lock' the selection of after the user makes a selection, then either moves to the next record or saves the form. This selection will therefore be unable to be changed afterwards.
From my research, I'm assuming that the following code needs to be placed into form_current event somehow:
Code:
Private Sub PHIconsultantcombo_LostFocus() PHIconsultantcombo.Locked = (PHIconsultantcombo.Text <> "") End Sub
Code:
Private Sub Form_Current()
Me.RecordsetClone.MoveLast
Me.RecordsetClone.MoveFirst
If Me.Lead_State <> "WA" Then
Me.Statewarning = Null
Else
Me.Statewarning = "Note: THC is not sold in WA"
End If
If Me.RecordsetClone.RecordCount = CurrentRecord Then
Me.but_next.Enabled = False
Me.but_last.Enabled = False
Else
Me.but_next.Enabled = True
Me.but_last.Enabled = True
End If
If CurrentRecord = 1 Then
Me.but_previous.Enabled = False
Me.but_first.Enabled = False
Else
Me.but_previous.Enabled = True
Me.but_first.Enabled = True
End If
End Sub
Comment