I've posted questions about this before, and I'm making progress but I still can't get it to work the way I need it to.
So I have an option group with three options: contract, project request, other. Next to the contract and project request options there are dropdown boxes. The dropdown boxes are populated from other tables with the different projects that exist. The other option has a textbox next to it to be filled in.
The way it is now, I have it so that if you choose one of the options, say contract, then the dropdown box next to contract is the only one that is enabled. And if you switch your choice, the choice you switch to has the only available box next to it.
The next step is what I need help with. If you have chosen contract and make a choice in the dropdown box, then change to project request I have finally figured out how to reset the first box so that nothing is entered there or into the table. However, when you click in the enabled dropdown box, the choice in the option group resets to the default value.
I’m not too experienced in VBA, but I’ll post the code I have below. Any suggestions on how to improve what I’m doing and to make it so that the option group value isn’t reset to the default value? Thanks in advance.
Thanks again
G
So I have an option group with three options: contract, project request, other. Next to the contract and project request options there are dropdown boxes. The dropdown boxes are populated from other tables with the different projects that exist. The other option has a textbox next to it to be filled in.
The way it is now, I have it so that if you choose one of the options, say contract, then the dropdown box next to contract is the only one that is enabled. And if you switch your choice, the choice you switch to has the only available box next to it.
The next step is what I need help with. If you have chosen contract and make a choice in the dropdown box, then change to project request I have finally figured out how to reset the first box so that nothing is entered there or into the table. However, when you click in the enabled dropdown box, the choice in the option group resets to the default value.
I’m not too experienced in VBA, but I’ll post the code I have below. Any suggestions on how to improve what I’m doing and to make it so that the option group value isn’t reset to the default value? Thanks in advance.
Code:
Private Sub Option36_GotFocus()
[Other].Enabled = False
[ContractDrop].Enabled = True
[ProjectDrop].Enabled = False
[Other].Undo
[ProjectDrop].Undo
End Sub
Private Sub Option36_LostFocus()
Me.Undo
End Sub
Private Sub Option38_GotFocus()
[Other].Enabled = False
[ContractDrop].Enabled = False
[ProjectDrop].Enabled = True
[Other].Undo
End Sub
Private Sub Option38_LostFocus()
Me.Undo
End Sub
Private Sub Option40_GotFocus()
[Other].Enabled = True
[ProjectDrop].Enabled = False
[ContractDrop].Enabled = False
[ProjectDrop].Undo
End Sub
Private Sub Option40_LostFocus()
Me.Undo
End Sub
Thanks again
G