PC Review


Reply
Thread Tools Rate Thread

coding between subforms

 
 
Krykota
Guest
Posts: n/a
 
      2nd Jun 2010
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!!!
 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      2nd Jun 2010
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" <(E-Mail Removed)> wrote in message
news:5C63F170-0A75-4F2B-8F31-(E-Mail Removed)...
> 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!!!



 
Reply With Quote
 
Krykota
Guest
Posts: n/a
 
      3rd Jun 2010
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" <(E-Mail Removed)> wrote in message
> news:5C63F170-0A75-4F2B-8F31-(E-Mail Removed)...
> > 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!!!

>
>
> .
>

 
Reply With Quote
 
Jeff Boyce
Guest
Posts: n/a
 
      3rd Jun 2010
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" <(E-Mail Removed)> wrote in message
news:F438B0BA-4974-4794-80D0-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:5C63F170-0A75-4F2B-8F31-(E-Mail Removed)...
>> > 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!!!

>>
>>
>> .
>>



 
Reply With Quote
 
Krykota
Guest
Posts: n/a
 
      3rd Jun 2010
My apologies Jeff. I will be more attentitive in the future. Thanks for your
response.

"Jeff Boyce" wrote:

> 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" <(E-Mail Removed)> wrote in message
> news:F438B0BA-4974-4794-80D0-(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> >> news:5C63F170-0A75-4F2B-8F31-(E-Mail Removed)...
> >> > 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!!!
> >>
> >>
> >> .
> >>

>
>
> .
>

 
Reply With Quote
 
Krykota
Guest
Posts: n/a
 
      3rd Jun 2010
Marshall, thank you for your help. SPOT ON!!!!!! Quick, easy, and highly
functional.

THANK YOU!!!!

"Marshall Barton" wrote:

> 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]
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: SQL syntax for subforms of subforms that must relate. Daryl S Microsoft Access Form Coding 0 8th Feb 2010 05:46 PM
Tabbed SubForms Coding - Return to First Tab? Robert T Microsoft Access Form Coding 5 27th May 2008 08:51 PM
2 subforms on a main form - both subforms not refreshing =?Utf-8?B?THl0aGFuZHJh?= Microsoft Access Form Coding 2 20th Apr 2006 08:05 PM
Subforms vs Good ol fashioned coding Dave Cousineau Microsoft Access Form Coding 10 18th Dec 2003 09:28 PM
Coding Subforms in More than One Main Form S Jackson Microsoft Access Getting Started 1 19th Nov 2003 06:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:34 AM.