Making Control Visible only if a condition on another field is met

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working on a form which displays records on continuous forms view, and I
want a check box to become visible on each record only if another field in
the form meets a certain criteria. I just can't get it to work correctly.
What I'm trying to do is that if the field named Keep = 0, then the CheckBox1
will be visible, but if Keep = -1, then CheckBox1 will not be visible.

The code I have now is:
If Me.Keep = -1 Then
Me.CheckBox1.Visible = False
End If

But what happens is that the checkbox is never visible

Any suggestions on how to do this?
 
Code has to be tied to an event. That event determines when the code runs.
Sharing that with us is almost as important as sharing the code itself.
Where is this code?
 
The form opens, the user is asked to type in some information. After that
information is entered, the records are retrieved and are displayed in
continuous forms view. One of the fields in this continuous forms view is
the checkbox that I want to be visible or invisible depending on the value in
another field.

I have tried putting the code in OnOpen for the form and also tried
AfterUpdate to run after the user enters their information, but neither place
made this work correctly.
 
I think it has to go in the "on curent" event of the subform. If the
subform is in DATASHEET view, I don't think it will work.

(I'm not 100% sure it will work at all since you are not hitting each
record)

Using conditional formatting might be a better way to do this.
 
I will try that. I tried conditional formatting as my very first option, but
Access won't give me the option to use that type of formatting on a checkbox.
 
Back
Top