Lock Combo box after focus on subform

flavioso

Registered User.
Local time
Today, 05:24
Joined
Jan 21, 2008
Messages
16
Hello. I have a main form which has a list of vendors in a combo box. Once the user selects the vendor, and starts keying in order information in the subform, I want the combo box to be locked.

I have tried using the On Got Focus with the following code, but unable to do so. The subform name is frmSUBDOCKET. the combo box is called cboVENDOR and is located on the main form called frmDOCKET.

cboVENDOR has this code attached to it in afterUpdate:

Code:
Private Sub fldVENDORID_AfterUpdate()
Me!frmDETAILS.Form!cboPN.Requery
End Sub
frmSUBDOCKET on Got Focus Code:

Code:
Private Sub Form_GotFocus()
Me.frmDOCKET!fldVENDORID.Locked = False
End Sub
The problem is that the combo box doesn't lock. Does anyone have any suggestions?


Thanks in advance,

Brad
 
Last edited:
For starters, to lock it would be True, not False. Second, if that code is in the subform, you'd need to reference the main form, not Me. Third, you need to refer to the combo, not the field. Try:

Forms!frmDOCKET.cboVENDOR.Locked = True
 

Users who are viewing this thread

Back
Top Bottom