Locking data entered from a bound combo box.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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)
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top