.visible in form

Carl_R

Registered User.
Local time
Today, 12:51
Joined
Aug 16, 2002
Messages
82
I have a form with a text box (ClosedDate) and a checkbox (Closed). ClosedDate is defined in my table as Date/Time and Closed as Yes/No.

What I want is, when a user clicks the checkbox(Closed), the textbox(ClosedDate) appears.

I have played with .Visible and sort of got it to work. Problem is, when I click the checkbox(Closed), the textbox(ClosedDate) appears in every record (ie. when I cycle through my records in the form, the textbox is visible).

Any help appreciated.
 
There's a wonderful event procedure called Form_Current that executes every time you navigate to a new record. Here's what you put in it.

Private Sub Form_Current()
ClosedDate.visible = Closed
End Sub

Let me know how that works. I think I might be forgetting something.

Keagan
 
This way has always worked for me:

In the AfterUpdate Property of the Check box:

If Me.Closed = 0 Then
Me.ClosedDate.Visible = False
Else
Me.ClosedDate.Visible = True
End If

Also add the same code to the OnCurrent property of the form.
 
it works!

Thanks Audrey, you're a legend - works a treat :)
 

Users who are viewing this thread

Back
Top Bottom