Originally posted by Rockey
you have two text boxes...
the user click on textbox1
your code disables texbox2
Because textbox2 is now disable - it can not have the focus set to it by either tabbing or clicking on it because it is disabled.
So you can disable one control by clicking on the other - but now you are stuck unless you enable it by other methods/events. A disabled control will not receive its events.
I want to disable user input of one field while the check mark beside that field is off (standard), BUT then the value should be calculated from a percentage given in a different field... so it cannot be locked either. When placing a check mark beside the field, the calculation from the latter should be disabled, and the field should change its background color, set the focus there and be editable from the keyboard...
Here is some code:
Private Sub chkcomm_manual_AfterUpdate()
If Me.chkcomm_manual = vbOK Then
Me.txtCalcSelOurComm.BackColor = 15000804
Me.txtCalcSelOurComm.TabStop = True
Me.txtour_sales_commission.BackColor = 12632256
Me.txtour_sales_commission.TabStop = False
Me.txtCalcSelOurComm.BackColor = 12632256
Me.txtCalcSelOurComm.TabStop = False
Me.txtour_sales_commission.BackColor = 8454143
Me.txtour_sales_commission.TabStop = True
I think the if logic and the "= vbOK" is incorrect, lacking something, since it only sets the focus on txtour_sales_commission whether I check or uncheck the checkbox. Seems like it is performing the Else part no matter what.