(Un)Hide field based on toggle on a form.

racer25

Slowly Getting There
Local time
Today, 12:23
Joined
May 30, 2005
Messages
65
Hi Guys,

I tried some code examples found on here but owing to my level of expertise unable to figure it out.

I have Toggle28 which has code

Code:
Private Sub Toggle28_Click()
If Me.Toggle28 = -1 Then 'if pressed in
Me.Toggle28.Caption = "Hide Notes"
Else
Me.Toggle28.Caption = "View Notes"
End If
End Sub

And a memo field called Notes

On click on the toggle I would like hide/unhide this field.

Could you assist please,

Cheers,

Rob
 
Instead of the click event use the After Update event and put:
Code:
If Me.Toggle28 = True Then 'if pressed in
   Me.Toggle28.Caption = "View Notes"
   Me.YourNotesTextBox.Visible = False
Else
   Me.Toggle28.Caption = "Hide Notes"
   Me.YourNotesTextBox.Visible = True
End If
 
Thanks worked a treat
 

Users who are viewing this thread

Back
Top Bottom