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
|
|||
|
|||
Dependent subform?
I'm trying to have a subform appear on my main form if a certain value is
selected from a combobox, but I'm having some trouble. I put the following code in the AfterUpdate field of my combobox but it doesn't work? Private Sub ServiceTypeSEIU_AfterUpdate(Cancel As Integer) If Me.ServiceType = "SEIU" Then Me.SEIU_Only_Query.Form .Enabled = True .Visible = True Else: Me.SEIU_Only_Query.Form .Enabled = False .Visable = False End If End Sub Can someone please help? Thanks, ~Gabe |
#2
|
|||
|
|||
Dependent subform?
You shouldn't need to enable/disable a subform if you are making it
Visible/Hidden. Is SEIU_Only_Query the actual name of the subform control, or the subform? You need the name of the control, and you need to leave off the .Form. Your code should look like: Private Sub ServiceTypeSEIU_AfterUpdate(Cancel As Integer) If Me.ServiceType = "SEIU" Then Me.SEIU_Only_Query.Visible = True Else Me.SEIU_Only_Query.Visible = False End If End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Gabe" wrote in message ... I'm trying to have a subform appear on my main form if a certain value is selected from a combobox, but I'm having some trouble. I put the following code in the AfterUpdate field of my combobox but it doesn't work? Private Sub ServiceTypeSEIU_AfterUpdate(Cancel As Integer) If Me.ServiceType = "SEIU" Then Me.SEIU_Only_Query.Form .Enabled = True .Visible = True Else: Me.SEIU_Only_Query.Form .Enabled = False .Visable = False End If End Sub Can someone please help? Thanks, ~Gabe |
#3
|
|||
|
|||
Dependent subform?
"having some trouble" doesn't give us much to go on ...
(by the way, if you haven't told Access to use an object, it doesn't know what you are referring to. I usually use the "With" command...) (by the way, two ... your code appears to be for a control named "ServiceTypeSEIU", but you test for "ServiceType" = "SEIU". ) Regards Jeff Boyce Microsoft Office/Access MVP "Gabe" wrote in message ... I'm trying to have a subform appear on my main form if a certain value is selected from a combobox, but I'm having some trouble. I put the following code in the AfterUpdate field of my combobox but it doesn't work? Private Sub ServiceTypeSEIU_AfterUpdate(Cancel As Integer) If Me.ServiceType = "SEIU" Then Me.SEIU_Only_Query.Form .Enabled = True .Visible = True Else: Me.SEIU_Only_Query.Form .Enabled = False .Visable = False End If End Sub Can someone please help? Thanks, ~Gabe |
#4
|
|||
|
|||
Dependent subform?
Nevermind I got it. Thanks for all your help though.
~Gabe "Arvin Meyer MVP" wrote: You shouldn't need to enable/disable a subform if you are making it Visible/Hidden. Is SEIU_Only_Query the actual name of the subform control, or the subform? You need the name of the control, and you need to leave off the .Form. Your code should look like: Private Sub ServiceTypeSEIU_AfterUpdate(Cancel As Integer) If Me.ServiceType = "SEIU" Then Me.SEIU_Only_Query.Visible = True Else Me.SEIU_Only_Query.Visible = False End If End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Gabe" wrote in message ... I'm trying to have a subform appear on my main form if a certain value is selected from a combobox, but I'm having some trouble. I put the following code in the AfterUpdate field of my combobox but it doesn't work? Private Sub ServiceTypeSEIU_AfterUpdate(Cancel As Integer) If Me.ServiceType = "SEIU" Then Me.SEIU_Only_Query.Form .Enabled = True .Visible = True Else: Me.SEIU_Only_Query.Form .Enabled = False .Visable = False End If End Sub Can someone please help? Thanks, ~Gabe |
Thread Tools | |
Display Modes | |
|
|