button becomes visible when record changes

D

Dan

I have a button that I want to become visible when the a
text box that is named "Status" has the phrase Accounts
Receivable stored in the record that is displayed on the
screen. Right now I have it so that if you change the
status to accounts receivable then the button becomes
visible. But if you are flipping through the records the
button does not become visible and I need it to. This is
the code I have:

Private Sub Form_Current()

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

If Me.Status = "AR - In Matching" Then
Me.ARButton.Visible = True
Else
Me.ARButton.Visible = False
End If

End Sub

This particular code is stored in the "On Current" event
which says that it should run every time the focus changes
form one record to another. Any help would be appreciated.
Thanks
 
E

Elwin

Private Sub Form_Current()
Select Case Me.Status
Case "Account Recievable","AR - In Matching"
Me.ARButton.Visible = True
Case Else
Me.ARButton.Visible = False
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