Visible Property

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Hello,

I'm trying to enter the following code in a form but its not working the way
I want it. This is what i'm trying to accomplish. The
btnContinuePaymentValidation runs a macro that takes the user to a different
form once the user is done entering the data on the form. However, I only
want the button to appear when txtPayAmtTotal = txtCheckAmountTotal.
Othwerwise the suer will continue without balancing for the day.

Private Sub Form_Dirty(Cancel As Integer)
If Me.txtPayAmtTotal = Me.txtCheckAmountTotal Then
Me.btnContinuePaymentValidation.Visible = True
Else
Me.btnContinuePaymentValidation.Visible = False
End If

Any feedback will be appreciated...

Thank You
 
You can put code in the after update event of every updateable control like
this:

If Me.txtPayAmtTotal = Me.txtCheckAmountTotal Then
Me.btnContinuePaymentValidation.Visible = True
Else
Me.btnContinuePaymentValidation.Visible = False
End If



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Even simpler:
Me.btnContinuePaymentValidation.Visible = (Me.txtPayAmtTotal =
Me.txtCheckAmountTotal)
-TedMi
 
Back
Top