Prev: read focus of controls
Next: Database crashing
From: Krykota on 2 Jun 2010 13:15 In Access 2007, I have a main form housing a tab control. On one page of my tab control, I have two subforms. The first subform lists my customers getting the data from a query in which I merge the first and last names and have a customer id (two fields). This form presents data in a continuous form list. The second subform has the detailed information on the customer. My goal and intent is to be able to click either on a button (linked to the customer id), the name of the customer, or even utilize toggle buttons (in which the caption is the customer name - preferred as a method to highlight the selected customer) and the detailed data on the customer is displayed in the second subform. I have tried doing an OnClick macro on the name, however, I am unable to direct my attention into the correct form (says it cannot find the form) even when I use the wizard to create the macro. Any help is greatly appreciated. Thanks in advance!!!
From: Jeff Boyce on 2 Jun 2010 17:06 When referring to an embedded subform, you need to call out the complete path. Something like (untested): Forms!YourMainForm!YourSubformControlName.Form!YourControlOnSubform Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "Krykota" <Krykota(a)discussions.microsoft.com> wrote in message news:5C63F170-0A75-4F2B-8F31-955784861551(a)microsoft.com... > In Access 2007, I have a main form housing a tab control. On one page of > my > tab control, I have two subforms. The first subform lists my customers > getting the data from a query in which I merge the first and last names > and > have a customer id (two fields). This form presents data in a continuous > form list. The second subform has the detailed information on the > customer. > > My goal and intent is to be able to click either on a button (linked to > the > customer id), the name of the customer, or even utilize toggle buttons (in > which the caption is the customer name - preferred as a method to > highlight > the selected customer) and the detailed data on the customer is displayed > in > the second subform. > > I have tried doing an OnClick macro on the name, however, I am unable to > direct my attention into the correct form (says it cannot find the form) > even > when I use the wizard to create the macro. > > Any help is greatly appreciated. > > Thanks in advance!!!
From: Marshall Barton on 3 Jun 2010 09:29 Krykota wrote: >In Access 2007, I have a main form housing a tab control. On one page of my >tab control, I have two subforms. The first subform lists my customers >getting the data from a query in which I merge the first and last names and >have a customer id (two fields). This form presents data in a continuous >form list. The second subform has the detailed information on the customer. > >My goal and intent is to be able to click either on a button (linked to the >customer id), the name of the customer, or even utilize toggle buttons (in >which the caption is the customer name - preferred as a method to highlight >the selected customer) and the detailed data on the customer is displayed in >the second subform. > >I have tried doing an OnClick macro on the name, however, I am unable to >direct my attention into the correct form (says it cannot find the form) even >when I use the wizard to create the macro. > I don't do macros, but if you can live with a little VBA code or can translate VBA to a macro, you can synchronize two subforms automatically without a button or any other user action. Add a hidden text box (named txtLink) to the main form. Then add a line of VBA code to the continuous subform's Current event procedure: Parent.txtLink = Me.theprimarykeyfield With that in place, the single view subform control can set the Link Master property to txtLink and the Link Child property to theprimarykeyfield. This way the single view subform will always display the details for whatever record you make current in the continuous subform, regardless of how you navigate to it. -- Marsh MVP [MS Access]
From: Krykota on 3 Jun 2010 12:41 Jeff, thanks for the reply. I verified that the path is complete and I still get the message that Access cannot find what I ask of it. Here is what I have as an OnClick event: Forms!RepairLab!Form!CustomerDetail!CustomerID = Forms!RepairLab!Form!CustomerList![CustomerID] The idea is that by clicking on the name of the customer, the accompanying subform CustomerDetail will filter to display the information on the customer selected in the CustomerList subform. There are two subforms on one tab control page form. Would putting a hidden CustomerID control on the main form help link the two subforms to allow for the filtering? If so, how would I direct focus from the list to the detail? "Jeff Boyce" wrote: > When referring to an embedded subform, you need to call out the complete > path. Something like (untested): > > Forms!YourMainForm!YourSubformControlName.Form!YourControlOnSubform > > > Regards > > Jeff Boyce > Microsoft Access MVP > > -- > Disclaimer: This author may have received products and services mentioned > in this post. Mention and/or description of a product or service herein > does not constitute endorsement thereof. > > Any code or pseudocode included in this post is offered "as is", with no > guarantee as to suitability. > > You can thank the FTC of the USA for making this disclaimer > possible/necessary. > > "Krykota" <Krykota(a)discussions.microsoft.com> wrote in message > news:5C63F170-0A75-4F2B-8F31-955784861551(a)microsoft.com... > > In Access 2007, I have a main form housing a tab control. On one page of > > my > > tab control, I have two subforms. The first subform lists my customers > > getting the data from a query in which I merge the first and last names > > and > > have a customer id (two fields). This form presents data in a continuous > > form list. The second subform has the detailed information on the > > customer. > > > > My goal and intent is to be able to click either on a button (linked to > > the > > customer id), the name of the customer, or even utilize toggle buttons (in > > which the caption is the customer name - preferred as a method to > > highlight > > the selected customer) and the detailed data on the customer is displayed > > in > > the second subform. > > > > I have tried doing an OnClick macro on the name, however, I am unable to > > direct my attention into the correct form (says it cannot find the form) > > even > > when I use the wizard to create the macro. > > > > Any help is greatly appreciated. > > > > Thanks in advance!!! > > > . >
From: Jeff Boyce on 3 Jun 2010 15:17
The expression you posted does not use the same syntax as the expression I offered. Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "Krykota" <Krykota(a)discussions.microsoft.com> wrote in message news:F438B0BA-4974-4794-80D0-A250C6D20393(a)microsoft.com... > Jeff, thanks for the reply. > > I verified that the path is complete and I still get the message that > Access > cannot find what I ask of it. > > Here is what I have as an OnClick event: > > Forms!RepairLab!Form!CustomerDetail!CustomerID = > Forms!RepairLab!Form!CustomerList![CustomerID] > > The idea is that by clicking on the name of the customer, the accompanying > subform CustomerDetail will filter to display the information on the > customer > selected in the CustomerList subform. There are two subforms on one tab > control page form. > > Would putting a hidden CustomerID control on the main form help link the > two > subforms to allow for the filtering? If so, how would I direct focus from > the list to the detail? > > "Jeff Boyce" wrote: > >> When referring to an embedded subform, you need to call out the complete >> path. Something like (untested): >> >> Forms!YourMainForm!YourSubformControlName.Form!YourControlOnSubform >> >> >> Regards >> >> Jeff Boyce >> Microsoft Access MVP >> >> -- >> Disclaimer: This author may have received products and services mentioned >> in this post. Mention and/or description of a product or service herein >> does not constitute endorsement thereof. >> >> Any code or pseudocode included in this post is offered "as is", with no >> guarantee as to suitability. >> >> You can thank the FTC of the USA for making this disclaimer >> possible/necessary. >> >> "Krykota" <Krykota(a)discussions.microsoft.com> wrote in message >> news:5C63F170-0A75-4F2B-8F31-955784861551(a)microsoft.com... >> > In Access 2007, I have a main form housing a tab control. On one page >> > of >> > my >> > tab control, I have two subforms. The first subform lists my customers >> > getting the data from a query in which I merge the first and last names >> > and >> > have a customer id (two fields). This form presents data in a >> > continuous >> > form list. The second subform has the detailed information on the >> > customer. >> > >> > My goal and intent is to be able to click either on a button (linked to >> > the >> > customer id), the name of the customer, or even utilize toggle buttons >> > (in >> > which the caption is the customer name - preferred as a method to >> > highlight >> > the selected customer) and the detailed data on the customer is >> > displayed >> > in >> > the second subform. >> > >> > I have tried doing an OnClick macro on the name, however, I am unable >> > to >> > direct my attention into the correct form (says it cannot find the >> > form) >> > even >> > when I use the wizard to create the macro. >> > >> > Any help is greatly appreciated. >> > >> > Thanks in advance!!! >> >> >> . >> |