Object error on an Option Button

G

Garry

Hello

I have a userform with a multipage control with textboxes and a frame
containing an optionbox. The code for the option box is

If frmAddPayments.OptionButton1.Value = True Then
Sheets("payments").txtTax.Value = "Includes"
ElseIf frmAddPayments.OptionButton2.Value = True Then
txtTax.Value = "Excludes"
Else
txtTax.Value = "Non Taxable"
End If
What I am trying to do is to fill a cell with include exclude or Non
Taxable.
I use the DIM txtTax, txtType to declare the variables in the form
initialise statement.

I get the error object required. How do i refer to this and am I doing
it right?
garry
 
B

Bob Phillips

Is txtTav a textbox on the worksheet or are you trying to get at the textbox
on the form? If the latter, not uses a Sheets qualifier, use Me.
 
G

Garry

The txtTax is supposed to be a variable that I can use to set a cell to
a value. ie x=5 or x=true then put that into a cell.

I am new to this so don't assume anything and you can be as blunt as you
like as long as I get this working <g>.

tx

garry
 

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