Jpg visible if check box is checked

  • Thread starter Thread starter eb1mom
  • Start date Start date
E

eb1mom

I have a form with a check box named final and an embedded
signature JPG with visible property set to no. If the box
is checked I want the signature visible, not checked
signature is not visible. I am using following code.I have
inserted code many places on form. On click of the check
box, after update of the check box, on load of the form and
results are not good. If box is checked on any record,
signature is visible on all. What am I messing up on? Thanks

If final.Value = -1 Then Me.Signature.Visible = True
If final.Value = 0 Then Me.Signature.Visible = False
 
You're missing the End If, and the Me operator (on the
final.value). Also, it's convention to use the bang
operator to separate a member from its collection, and to
use a period to preceed a property or method.

By using built-in VBA constants and indentations, your
code is also more readable.

Try:

If Me!final.Value = vbTrue
Then Me!Signature.Visible = True
Else Me.Signature.Visible = False
End If

If you like, you can omit the Value property, since it is
the default property for a form control.

If Me!final = vbTrue
Then Me!Signature.Visible = True
Else Me.Signature.Visible = False
End If


HTH
Kevin Sprinkel
 
Is the check box bound to the same datasource as the
recordset of the form? If not that could be your problem
 
Back
Top