Log in

View Full Version : Form option button not working


dannac
May 19, 2011, 02:45 PM
Code:
' Transfers Amount
If OptionButton1 Then Cells(Nextrow, 4) = TextBox4.Value
If OptionButton2 Then Cells(Nextrow, 5) = TextBox4.Value


Problem is with OptionButton2

OptionButton2 is inputting TextBox value to col 4 and col 5.

As if OptionButton1 does not get turned off when I select OptionButton2.

Both option buttons are within a frame on a form.

OptionButton1 works correctly.

JBeaucaire
May 19, 2011, 03:31 PM
Can you post a file with this form and instructions on testing/seeing the error duplicated?

dannac
May 20, 2011, 11:07 AM
This is fixed... Thanks

This works

' Transfers Amount
If OptionButton1 Then
Cells(Nextrow, 4) = TextBox4.Value
Cells(Nextrow, 5) = ""
End If

If OptionButton2 Then
Cells(Nextrow, 5) = TextBox4.Value
Cells(Nextrow, 4) = ""
End If