Hiding Columns in a Datasheet Subform Based on an Option Box Selection

J

Jon Campbell

Hello,

I have a Database in a Home Furnishings company.

The Buyers want to have different Excel-like views of data based on the task
at hand.

My plan was to have a Main form with basic drill down criteria, linked to a
subform that will display related data. I created an Option group with
choices based on Function- i.e. Development, Pricing, etc

I followed an example on mdsn but have had no luck

'frmWIP is subform, Style is column I want to hide based on selecting 2 in
obWIPView on main form, frmWIPMain


If Forms!frmWipMain.obWIPView = 2 Then
Forms!frmWIP!Style.ColumnHidden = -1
Else Beep
End If

Thanks in Advance,

Jon Campbell
 
J

Jon Campbell

Thanks for the reply. I tried that method and the Main form does not
recognize the subform when I call it in the Procedure.I will keep playing
with it.

In the meantime I reviewed the requirements with the user and instead opted
for a 'stacked subforms' that will get turned on and off based on a
selection in a pulldown.

I modeled it based on
http://www.techonthenet.com/access/subforms/multi_subforms.php



Sub ShowSubform()

'Save unsaved changes to currently open subform
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

'Display appropriate subform based on Template_type chosen

If comDetailView = "All" Then
subfrmWIP_All.Visible = True
subfrmWIP_Pricing.Visible = False
subfrmWIP_Production.Visible = False

ElseIf comDetailView = "Pricing" Then
subfrmWIP_All.Visible = False
subfrmWIP_Pricing.Visible = True
subfrmWIP_Production.Visible = False


ElseIf comDetailView = "Production" Then
subfrmWIP_All.Visible = False
subfrmWIP_Pricing.Visible = False
subfrmWIP_Production.Visible = True

Else
subfrmWIP_All.Visible = False
subfrmWIP_Pricing.Visible = False
subfrmWIP_Production.Visible = False

End If

End Sub



Thanks again,

Jon Campbell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top