Checkbox help

R

ryan.fitzpatrick3

I have 3 check boxes with 3 text boxes adjacent to them. I
have code where which ever check box I check the other two are
disabled. So i.e. in checkbox1 I click it checkbox2 and 3 are
disabled. So in textbox1 I type in the quantity, and this works, but I
can click checkbox2 or 3 and checkbox1 will be disabled even with the
quantity in it. How can I get it where if checkbox1 is clicked and
textbox1 has a number in it that you can't click any another check box
or
text box until that quantity in textbox1 is deleted. Also when I move
between records it doesn't stay checked, how do I get it to stay on
the check box that is selected between records? Here is my code
thus far.

Private Sub Form_Current()
Select Case OptGroupFreight
Case 1
FreightTLQuantity.Enabled = True
FreighthalfLTLQuantity.Enabled = False
FreightthirdLTLQuantity.Enabled = False

Case 2
FreighthalfLTLQuantity.Enabled = True
FreightTLQuantity.Enabled = False
FreightthirdLTLQuantity.Enabled = False

Case 3
FreightthirdLTLQuantity.Enabled = True
FreightTLQuantity.Enabled = False
FreighthalfLTLQuantity.Enabled = False
End Select
End Sub

Thank you for your time.
 
J

Jeff Boyce

I'm missing something.

If you check checkbox1, and cbox2 and cbox3 are disabled, how do you then
check cbox2 or cbox3?

If you are referring to the textboxes being disabled, that's different.

And you can add code behind the control (use the AfterUpdate event) that
clears the textboxes that belong to the other checkboxes.

Or, rather than using that complex arrangement, how about a single textbox
and an option group that lets you pick one of three choices?

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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

Similar Threads


Top