Make a command button and name it cmdEnableDisable
Select the button then Goto Properties -- Format and make Caption = "Enable
Combo Box"
Select your Combo Box then Goto Properties -- Data and set Enabled to NO
Here's two code variations:
'This will simply enable the combo box with no way to disable it
Private Sub cmdEnableDisable_Click()
YourComboBox.Enabled = True
End Sub
'This will use the single command button to
'Enable and Disable the combo box
Private Sub cmdEnableDisable_Click()
If YourComboBox.Enabled = False Then
YourComboBox.Enabled = True
cmdEnableDisable.Caption = "Disable Combo Box"
Else
YourComboBox.Enabled = False
cmdEnableDisable.Caption = "Enable Combo Box"
End If
End Sub
'If you use the second code example you'll need
'this to reset the state when moving from record
'to record (if user forgets to click the button again)
Private Sub Form_Current()
YourComboBox.Enabled = False
cmdEnableDisable.Caption = "Enable Combo Box"
End Sub
--
There's ALWAYS more than one way to skin a cat!
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.