If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Hiding and Un-Hiding Data fields
I am using a form for people to select data via dropdown menus and then
having it run through a query to filter results. Is there a way that I can have certain feilds hidden until a toggle button or something of the like is clicked? Basically I want have three choices of buttons: Year, Quarter, and Month. What I ideally want to happen is when someone selects the button for year, a hidden drop down menu appears where they can then choose from the available years to filter through the query. I would say I am above average with using access, but I have no idea how to hide fields and then make them reappear using a macro or something similar. I would appreciate any help. Thanks. |
#2
|
|||
|
|||
Hiding and Un-Hiding Data fields
In design view of your form, set the combo box's Visible property to No.
Then create an option group on your form with the 3 choices. For example let's say the option values of the 3 options a Year 1 Quarter 2 Month 3 Then in the After Update event of the option group frame, use a Select Case statement to make the combo visible: Select Case Me.opgPeriod Case 1 Me.cboYear.Visible = True Case 2 'Do stuff for Quarter Case 3 'Do stuff for Month End Select Also, you will need to set the combo back to invisible in the form Current Event to change options for each record. Me.cboYear.Visible = False -- Dave Hargis, Microsoft Access MVP "ROL41" wrote: I am using a form for people to select data via dropdown menus and then having it run through a query to filter results. Is there a way that I can have certain feilds hidden until a toggle button or something of the like is clicked? Basically I want have three choices of buttons: Year, Quarter, and Month. What I ideally want to happen is when someone selects the button for year, a hidden drop down menu appears where they can then choose from the available years to filter through the query. I would say I am above average with using access, but I have no idea how to hide fields and then make them reappear using a macro or something similar. I would appreciate any help. Thanks. |
#3
|
|||
|
|||
Hiding and Un-Hiding Data fields
thanks a lot - im definately heading in the right direction. i have
everything up until the select case statement. So my combo box is combo12 and its titled "fiscal year". when i start entering my statement ive typed the Select Case Me. and then is there something i need to select from the list they give me, or am I typing in the name of the combo box? thanks for your help "Klatuu" wrote: In design view of your form, set the combo box's Visible property to No. Then create an option group on your form with the 3 choices. For example let's say the option values of the 3 options a Year 1 Quarter 2 Month 3 Then in the After Update event of the option group frame, use a Select Case statement to make the combo visible: Select Case Me.opgPeriod Case 1 Me.cboYear.Visible = True Case 2 'Do stuff for Quarter Case 3 'Do stuff for Month End Select Also, you will need to set the combo back to invisible in the form Current Event to change options for each record. Me.cboYear.Visible = False -- Dave Hargis, Microsoft Access MVP "ROL41" wrote: I am using a form for people to select data via dropdown menus and then having it run through a query to filter results. Is there a way that I can have certain feilds hidden until a toggle button or something of the like is clicked? Basically I want have three choices of buttons: Year, Quarter, and Month. What I ideally want to happen is when someone selects the button for year, a hidden drop down menu appears where they can then choose from the available years to filter through the query. I would say I am above average with using access, but I have no idea how to hide fields and then make them reappear using a macro or something similar. I would appreciate any help. Thanks. |
#4
|
|||
|
|||
Hiding and Un-Hiding Data fields
Use the name of the combo box.
Select Case Me.MyComboBoxName Case 1 ..... -- Dave Hargis, Microsoft Access MVP "ROL41" wrote: thanks a lot - im definately heading in the right direction. i have everything up until the select case statement. So my combo box is combo12 and its titled "fiscal year". when i start entering my statement ive typed the Select Case Me. and then is there something i need to select from the list they give me, or am I typing in the name of the combo box? thanks for your help "Klatuu" wrote: In design view of your form, set the combo box's Visible property to No. Then create an option group on your form with the 3 choices. For example let's say the option values of the 3 options a Year 1 Quarter 2 Month 3 Then in the After Update event of the option group frame, use a Select Case statement to make the combo visible: Select Case Me.opgPeriod Case 1 Me.cboYear.Visible = True Case 2 'Do stuff for Quarter Case 3 'Do stuff for Month End Select Also, you will need to set the combo back to invisible in the form Current Event to change options for each record. Me.cboYear.Visible = False -- Dave Hargis, Microsoft Access MVP "ROL41" wrote: I am using a form for people to select data via dropdown menus and then having it run through a query to filter results. Is there a way that I can have certain feilds hidden until a toggle button or something of the like is clicked? Basically I want have three choices of buttons: Year, Quarter, and Month. What I ideally want to happen is when someone selects the button for year, a hidden drop down menu appears where they can then choose from the available years to filter through the query. I would say I am above average with using access, but I have no idea how to hide fields and then make them reappear using a macro or something similar. I would appreciate any help. Thanks. |
#5
|
|||
|
|||
Hiding and Un-Hiding Data fields
awesome - thank you very much. one more quick question regarding this. is
there a way for the combo box to go back tonvisible if you select a different option from the option group? you know, if someone initially clicks year but they actually want month so they click month and the month pops up and the year disappears again thanks again! "Klatuu" wrote: Use the name of the combo box. Select Case Me.MyComboBoxName Case 1 ..... -- Dave Hargis, Microsoft Access MVP "ROL41" wrote: thanks a lot - im definately heading in the right direction. i have everything up until the select case statement. So my combo box is combo12 and its titled "fiscal year". when i start entering my statement ive typed the Select Case Me. and then is there something i need to select from the list they give me, or am I typing in the name of the combo box? thanks for your help "Klatuu" wrote: In design view of your form, set the combo box's Visible property to No. Then create an option group on your form with the 3 choices. For example let's say the option values of the 3 options a Year 1 Quarter 2 Month 3 Then in the After Update event of the option group frame, use a Select Case statement to make the combo visible: Select Case Me.opgPeriod Case 1 Me.cboYear.Visible = True Case 2 'Do stuff for Quarter Case 3 'Do stuff for Month End Select Also, you will need to set the combo back to invisible in the form Current Event to change options for each record. Me.cboYear.Visible = False -- Dave Hargis, Microsoft Access MVP "ROL41" wrote: I am using a form for people to select data via dropdown menus and then having it run through a query to filter results. Is there a way that I can have certain feilds hidden until a toggle button or something of the like is clicked? Basically I want have three choices of buttons: Year, Quarter, and Month. What I ideally want to happen is when someone selects the button for year, a hidden drop down menu appears where they can then choose from the available years to filter through the query. I would say I am above average with using access, but I have no idea how to hide fields and then make them reappear using a macro or something similar. I would appreciate any help. Thanks. |
#6
|
|||
|
|||
Hiding and Un-Hiding Data fields
Sure, in the code for each option, set the visible property as appropriate.
-- Dave Hargis, Microsoft Access MVP "ROL41" wrote: awesome - thank you very much. one more quick question regarding this. is there a way for the combo box to go back tonvisible if you select a different option from the option group? you know, if someone initially clicks year but they actually want month so they click month and the month pops up and the year disappears again thanks again! "Klatuu" wrote: Use the name of the combo box. Select Case Me.MyComboBoxName Case 1 ..... -- Dave Hargis, Microsoft Access MVP "ROL41" wrote: thanks a lot - im definately heading in the right direction. i have everything up until the select case statement. So my combo box is combo12 and its titled "fiscal year". when i start entering my statement ive typed the Select Case Me. and then is there something i need to select from the list they give me, or am I typing in the name of the combo box? thanks for your help "Klatuu" wrote: In design view of your form, set the combo box's Visible property to No. Then create an option group on your form with the 3 choices. For example let's say the option values of the 3 options a Year 1 Quarter 2 Month 3 Then in the After Update event of the option group frame, use a Select Case statement to make the combo visible: Select Case Me.opgPeriod Case 1 Me.cboYear.Visible = True Case 2 'Do stuff for Quarter Case 3 'Do stuff for Month End Select Also, you will need to set the combo back to invisible in the form Current Event to change options for each record. Me.cboYear.Visible = False -- Dave Hargis, Microsoft Access MVP "ROL41" wrote: I am using a form for people to select data via dropdown menus and then having it run through a query to filter results. Is there a way that I can have certain feilds hidden until a toggle button or something of the like is clicked? Basically I want have three choices of buttons: Year, Quarter, and Month. What I ideally want to happen is when someone selects the button for year, a hidden drop down menu appears where they can then choose from the available years to filter through the query. I would say I am above average with using access, but I have no idea how to hide fields and then make them reappear using a macro or something similar. I would appreciate any help. Thanks. |
Thread Tools | |
Display Modes | |
|
|