Smitty
Legend
- Joined
- May 15, 2003
- Messages
- 29,536
I have a main Navigation form and within it, on one of the tabs, I have a subform that has a detail view on it, then a subform on that one with a datasheet view for line items. I’m trying to get a field on the datasheet to toggle visibility depending on an option button selection on SubForm 1. I am using Master/Child links between the two forms.
Here’s what I’ve been trying with no success (the controls that aren’t commented are on subform1 and work fine):
<font face=Calibri><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> fra_SD_Dest_Click()<br><SPAN style="color:#007F00">' Single Location selected</SPAN><br> <SPAN style="color:#007F00">' Display Destination Type</SPAN><br> <SPAN style="color:#007F00">' Enable ShipTo Location on Detail form</SPAN><br> <SPAN style="color:#007F00">' Disable ShipTo location on LineItem form</SPAN><br> <br> <SPAN style="color:#00007F">With</SPAN> Me<br> <SPAN style="color:#007F00">' Ship to a Single Location</SPAN><br> <SPAN style="color:#00007F">If</SPAN> .fra_SD_Dest.Value = 1 <SPAN style="color:#00007F">Then</SPAN><br> .cbo_SD_Dest.Visible = <SPAN style="color:#00007F">True</SPAN><br> .cbo_SD_Dest.Value = 3<br> .cbo_SD_ShipTo.Enabled = <SPAN style="color:#00007F">True</SPAN><br> <SPAN style="color:#007F00">'[Forms]![frm_Dashboard]![NavigationSubform].[Form]![cbo_SLI_ShipTo].Enabled = False</SPAN><br> <SPAN style="color:#00007F">Else</SPAN><br> <SPAN style="color:#007F00">' Multiple Location selected</SPAN><br> <SPAN style="color:#007F00">' Hide Destination Type</SPAN><br> <SPAN style="color:#007F00">' Disable ShipTo Location on Detail form</SPAN><br> <SPAN style="color:#007F00">' Enable ShipTo location on LineItem form</SPAN><br> .cbo_SD_Dest.Visible = <SPAN style="color:#00007F">False</SPAN><br> .cbo_SD_ShipTo.Enabled = <SPAN style="color:#00007F">False</SPAN><br> <SPAN style="color:#007F00">'[Forms]![frm_Dashboard]![NavigationSubform].[Form]!Me.[cbo_SLI_ShipTo].Enabled = False</SPAN><br> <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br> <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
Here are the form names:
Navigation form: “frm_Dashboard”
Subform1: “frm_SalesDetails”
Subform2 on “frm_SalesDetails”: “frm_SalesLineItems”
The field I’m trying to toggle is: “cbo_SLI_ShipTo”
Any ideas on the proper syntax for that? If it’s just a plain form/subform relationship I can get it to work, but this whole Navigation form referencing throws me off completely.
Thanks!
Here’s what I’ve been trying with no success (the controls that aren’t commented are on subform1 and work fine):
<font face=Calibri><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> fra_SD_Dest_Click()<br><SPAN style="color:#007F00">' Single Location selected</SPAN><br> <SPAN style="color:#007F00">' Display Destination Type</SPAN><br> <SPAN style="color:#007F00">' Enable ShipTo Location on Detail form</SPAN><br> <SPAN style="color:#007F00">' Disable ShipTo location on LineItem form</SPAN><br> <br> <SPAN style="color:#00007F">With</SPAN> Me<br> <SPAN style="color:#007F00">' Ship to a Single Location</SPAN><br> <SPAN style="color:#00007F">If</SPAN> .fra_SD_Dest.Value = 1 <SPAN style="color:#00007F">Then</SPAN><br> .cbo_SD_Dest.Visible = <SPAN style="color:#00007F">True</SPAN><br> .cbo_SD_Dest.Value = 3<br> .cbo_SD_ShipTo.Enabled = <SPAN style="color:#00007F">True</SPAN><br> <SPAN style="color:#007F00">'[Forms]![frm_Dashboard]![NavigationSubform].[Form]![cbo_SLI_ShipTo].Enabled = False</SPAN><br> <SPAN style="color:#00007F">Else</SPAN><br> <SPAN style="color:#007F00">' Multiple Location selected</SPAN><br> <SPAN style="color:#007F00">' Hide Destination Type</SPAN><br> <SPAN style="color:#007F00">' Disable ShipTo Location on Detail form</SPAN><br> <SPAN style="color:#007F00">' Enable ShipTo location on LineItem form</SPAN><br> .cbo_SD_Dest.Visible = <SPAN style="color:#00007F">False</SPAN><br> .cbo_SD_ShipTo.Enabled = <SPAN style="color:#00007F">False</SPAN><br> <SPAN style="color:#007F00">'[Forms]![frm_Dashboard]![NavigationSubform].[Form]!Me.[cbo_SLI_ShipTo].Enabled = False</SPAN><br> <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br> <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
Here are the form names:
Navigation form: “frm_Dashboard”
Subform1: “frm_SalesDetails”
Subform2 on “frm_SalesDetails”: “frm_SalesLineItems”
The field I’m trying to toggle is: “cbo_SLI_ShipTo”
Any ideas on the proper syntax for that? If it’s just a plain form/subform relationship I can get it to work, but this whole Navigation form referencing throws me off completely.
Thanks!