Toggle Button

TobyMace

Registered User.
Local time
Today, 17:29
Joined
Apr 13, 2018
Messages
65
Hi All,


I have a toggle button that when clicked will make a sub report appear and when clicked again would make it disappear again.
I have tried to do this by assigning a macro to the OnClick to SetProperty visible of Courses_R to True.
I then assumed that clicking the toggle button again would revert that? (To assume is to make an ass out of u and me. I really have!)
Please help!
Or if any has an easier way to do this without a toggle button then I'd be most grateful.
Thanks in advance!
 
Never tried with a toggle button. It may be that you just need to move the focus from the report to something else first so it can be hidden.

Or use a standard command button with caption Show Report.
When you click the button, add code to open the report and change the caption to Hide
Report
Now use if ... Else. End if code with the above in the If section and the reverse code in the Else section.
 
Private Sub ButtonName_Click()

If ButtonName.Value = True Then

Me.Control.Visible = True
Me.Control.Height = 2.3
Me.Control.Width = 19.7
Me.Detail.Height = 2.5

Else:

Me.Control.Visible = False
Me.Control.Height = 1
Me.Control.Width = 1
Me.Detail.Height = 0.75

End If

End Sub


Is the solution. Doh! Seems simple now I know!
Hope this helps someone else out there!
 

Users who are viewing this thread

Back
Top Bottom