Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expand Or Collapse form footer 1

Status
Not open for further replies.

nikademous

Technical User
Sep 9, 2018
41
US
Hello, I have been trying to figure out how to get my switchboards(frm_Switchboard) form footer to expand or collapse based on Yes/No field in table (tbl_MenuItems). If I select an option that requires a start and end then collapse the footer and once dates are entered select the button again and it will open either the Form, Report ect and collapse the footer again. Can someone please take a look and see how I can do this?

I have a example button on the (frm_Switchboard) header that collapses and expands the footer I just need it to do it automatically based on the (tbl_MenuItems) field.

Thoughts....
 
 https://files.engineering.com/getfile.aspx?folder=8151329f-1bf6-4997-8559-f00df5fd0952&file=Switchboard_Menu_Template_v1_-_Copy.zip
Well you've pretty much already got the code you need for this in cmdToggleFooter_Click(). You just need aminor modification and stick something like the following after opening the recordset in HandleButtonClick

So, after

[tt]rs.Open stSql, con, 1
[/tt]

put

[tt][pre]If rs![ExpandFooter] = True Then
ExpandFooter
cmdToggleFooter.Caption = "Collapse"
Else
CollapseFooter
cmdToggleFooter.Caption = "Expand"
End If[/pre][/tt]
 
Thanks again stronm I wouldn't have guessed that's how/where!!!! I had to change it a little to get to work correctly.

Code:
   'Expand or Collaps footer based on tbl_MenuItems field: ExpandFooter
    If rs![ExpandFooter] = False Then
       If cmdToggleFooter.Caption = "Collapse" Then
        CollapseFooter
        cmdToggleFooter.Caption = "Expand"
        End If
    ElseIf rs![ExpandFooter] = True Then
        ExpandFooter
        cmdToggleFooter.Caption = "Collapse"
    End If

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top