Visible/Invis on moving between records in a Form

Brian1960

Brian1960
Local time
Today, 21:48
Joined
Aug 13, 2004
Messages
141
I have a bound form in Single View. I use buttons to navigate backwards and forwards through the records in a table.

Private Sub MoveNext_Click()
On Error Resume Next
DoCmd.GoToRecord , , acNext
End Sub

I have some fields that I want to make visible when a check box is ticked, but remain invisible when not ticked.

I use the following to set the visibility when the check box is updated,

Private Sub PrivateYN_AfterUpdate()
If Me.PrivateYN.Value = True Then
Call NamesVisible
Else
Call NamesInvisible
End If
End Sub

I can also set the visibilty correctly OnOpen but when I move to the next record I can't find the correct Event to make the Names either visible or invisible dependant on the new value of the PrivateYN checkbox.

Has anyone got an idea as I am stumped? I even tried adding the code
If Me.PrivateYN.Value = True Then
Call NamesVisible
Else
Call NamesInvisible
End If
to the MoveNext_Click Sub

I need help and some therapy.

Thanks
Brian
 
Use the on current event, its triggered every record thus enabling you to make visible/invisible as you desire...

Greetz
 
Thanks. You made me a happy man!
 

Users who are viewing this thread

Back
Top Bottom