Locking data entered from a bound combo box.

S

Sadie

I use a combo box to enter an account number and connected details from one
table, in a form based on another table. Once this is chosen, how do I lock
the information for that one record so that it cannot be changed
inadvertantly.
 
A

Allen Browne

You can use the Current event procedure of the form to set the Locked
property of the combo.

This example locks Combo1 unless the form is at a new record:
Private Sub Form_Current()
Me.[Combo1].Locked = Not Me.NewRecord
End Sub

This example locks the combo if it already has some value filled in:
Me.Combo1.Locked = Not IsNull(Me.Combo1)
 
S

Sadie

Thank you for that. Works well.

Allen Browne said:
You can use the Current event procedure of the form to set the Locked
property of the combo.

This example locks Combo1 unless the form is at a new record:
Private Sub Form_Current()
Me.[Combo1].Locked = Not Me.NewRecord
End Sub

This example locks the combo if it already has some value filled in:
Me.Combo1.Locked = Not IsNull(Me.Combo1)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Sadie said:
I use a combo box to enter an account number and connected details from one
table, in a form based on another table. Once this is chosen, how do I
lock
the information for that one record so that it cannot be changed
inadvertantly.
 
Top