Option Group question

R

ryan.fitzpatrick3

I have an option group with 3 choices and next to each choice I have a
textbox ( 3 in all). I imagine this is simple, but I'd like to have
for whatever checkbox in the optiongroup that is chosen the textbox to
the right of it be enabled, while the other two are disabled.

optiongroup name is OptGroupFreight
optionvalue 1 is check52 textbox is FreightTLQuantity
optionvalue 2 is check54 textbox is FreighthalfLTLQuantity
optionvalue 3 is check56 textbox is FreightthirdLTLQuantity

Thanks in advance.

Ryan
 
B

Beetle

You might use something like this in the current event of your form;

Me.FreightTLQuantity.Enabled = Me.OptGroupFreight = 1
Me.FreighthalfLTLQuantity.Enabled = Me.OptGroupFreight = 2
Me.FreightthirdLTLQuantity.Enabled = Me.OptGroupFreight = 3
 
L

Linq Adams via AccessMonster.com

Private Sub OptGroupFreight_AfterUpdate()
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
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
 
R

ryan.fitzpatrick3

I got another question for you regarding this. Now that the text box
that is next to the check mark shows, while the other two are not
enabled, lets say I have a quantity in textbox1 which is check1, or
optionvalue1 in the option group. I can write in a number in text box
1 but i can click check3 and disable the text box that has the
quantity in it. Is there away where if you have a quantity in a text
box you can't select the other two check boxes? I tried this code, it
worked buy disabling the text boxes and check boxes that didn't have
the quantity, but it wouldn't undo when I deleted the quantity out of
the first text box. Does that make sense?

Private Sub Form_afterUpdate()
Select Case OptGroupFreight
Case 1
If (Nz([FreightTLQuantity])) = False Then
Check54.Enabled = True
Check56.Enabled = True
End If
Case 2
If (Nz([FreighthalfLTLQuantity])) = False Then
Check52.Enabled = True
Check56.Enabled = True
End If
Case 3
If (Nz([FreightthirdLTLQuantity])) = False Then
Check52.Enabled = True
Check54.Enabled = True
End If
End Select
End Sub
 

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

Top