error in "if statement"

D

Dan

Could anyone tell me what is wrong with this? It must be
the word true and the word false. What I am trying to do
is set a button to be visible on the screen if the user
selectes the account recievable from the drop down list.
Visual Basics says that it does not recognize the words
true and false which must mean that is what is creating
the error right? Everything else will work correctly right?

If Me.Status = "Account Recievable" Then
Me.ARButtom.IsVisible = True
Else
Me.ARButtom.IsVisible = False
End If
 
T

Timothy C. Doherty

There is no property "IsVisible" for a button control. You need to reference
the "Visible" property:

If Me.Status = "Account Recievable" Then
Me.ARButtom.Visible = True
Else
Me.ARButtom.Visible = False
End If
 
S

Steve Schapel

Dan,

Try it like this...
If Me.Status = "Account Recievable" Then
Me.ARButtom.Visible = True
Else
Me.ARButtom.Visible = False
End If

This can be simplified to this...
Me.ARButtom.Visible = (Me.Status = "Account Recievable")

- Steve Schapel, Microsoft Access MVP
 
H

Hugh O'Neill

Steve said:
Dan,

Try it like this...
If Me.Status = "Account Recievable" Then
Me.ARButtom.Visible = True
Else
Me.ARButtom.Visible = False
End If

This can be simplified to this...
Me.ARButtom.Visible = (Me.Status = "Account Recievable")

- Steve Schapel, Microsoft Access MVP


And at the risk of being called a pedant (which I am!), there is a less
creative way of spelling 'receivable'!!

Hugh
 
M

Mike Painter

And at the risk of being called a pedant (which I am!), there is a less
creative way of spelling 'receivable'!!
Did we push one of your buttom's :)
At some point Me.whatever.something will get you in trouble and it will be
hard to find.

Get in the habit of using Me!something.whatever.
 
Top