1a572 Lookup Querey within subform of a subform
Sign Up |  Live StatsLive Stats    Articles 37,302| Comments 176,977| Members 19,397, Newest birinder| Online 373
Home Contact
 (Forgotten?): 
    Sikhism
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Sikh Philosophy Network » Sikh Philosophy Network » Current News » Information Technology » Lookup Querey within subform of a subform

Lookup Querey within subform of a subform

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 100 USD (20%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
dlookup in subform confused Information Technology 6 28-Jul-2006 08:18 AM
subform in VBA - Alex Information Technology 5 28-Jul-2006 08:18 AM
Subform Values F1stman Information Technology 4 28-Jul-2006 08:07 AM
Max Value in a subform Kevin Information Technology 1 28-Jul-2006 08:05 AM
comboboxes on subform papa jonah Information Technology 3 15-Nov-2005 14:11 PM


Tags
lookup, querey, within, subform
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 12-Nov-2005, 22:40 PM
Bob Richardson's Avatar Bob Richardson
Guest
 
Posts: n/a
   
   
Lookup Querey within subform of a subform

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
I have a Combobox table lookup query that works when I look at "FormA". The
Combo box is on a subform of Form A.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/7260-lookup-querey-within-subform-of-subform.html

SELECT Classes.ClassCode FROM Classes
WHERE ((Classes.EvCode)=Forms!FormA!EvCode)
ORDER BY Classes.ClassCode;

When I then make Form A a subform of the Main form, the above query no
longer works.

MainForm
FormA
SubForm

I am not using a situation where there are two subforms of a main form,
which would look like:

MainForm
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
Subform1
Subform2

I never want to just look at FormA by itself. It should always be a subform
of the main form. I just noticed that it worked when it wasn't a subform.

How should I change the query to work when FormA is a subform.




Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-Nov-2005, 22:40 PM
Douglas J. Steele's Avatar Douglas J. Steele
Guest
 
Posts: n/a
   
   
Re: Lookup Querey within subform of a subform

WHERE ((Classes.EvCode)=Forms!MainForm!Subform.Form!EvCo de)

"Subform" is the name of the contain where FormA resides on MainForm. If you
simply dragged FormA onto MainForm, it'll likely be named FormA, but double
check to be sure.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Bob Richardson" wrote in message
news:qbKdnZzJrstg2-jenZ2dnUVZ_t6dnZ2d@whidbeytel.com...
>I have a Combobox table lookup query that works when I look at "FormA". The
>Combo box is on a subform of Form A.
>
> SELECT Classes.ClassCode FROM Classes
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
> WHERE ((Classes.EvCode)=Forms!FormA!EvCode)
> ORDER BY Classes.ClassCode;
>
> When I then make Form A a subform of the Main form, the above query no
> longer works.
>
> MainForm
> FormA
> SubForm
>
> I am not using a situation where there are two subforms of a main form,
> which would look like:
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
>
> MainForm
> Subform1
> Subform2
>
> I never want to just look at FormA by itself. It should always be a
> subform of the main form. I just noticed that it worked when it wasn't a
> subform.
>
> How should I change the query to work when FormA is a subform.
>



Reply With Quote
  #3 (permalink)  
Old 12-Nov-2005, 22:40 PM
Bob Richardson's Avatar Bob Richardson
Guest
 
Posts: n/a
   
   
Re: Lookup Querey within subform of a subform

Still have a problem. It's asking for the parameter value of the right side
of the equation. Here's an exact copy:

WHERE ((Classes.EvCode)=Forms!MainForm!Subform.FormA!EvC ode)

I noticed in your reply that you used "Form!EvCode" I tried it that way and
also "FormA!EvCode" but neither worked.

"Douglas J. Steele" wrote in message
news:eD3cApy5FHA.3984@TK2MSFTNGP10.phx.gbl...
> WHERE ((Classes.EvCode)=Forms!MainForm!Subform.Form!EvCo de)
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
>
> "Subform" is the name of the contain where FormA resides on MainForm. If
> you simply dragged FormA onto MainForm, it'll likely be named FormA, but
> double check to be sure.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "Bob Richardson" wrote in message
> news:qbKdnZzJrstg2-jenZ2dnUVZ_t6dnZ2d@whidbeytel.com...
>>I have a Combobox table lookup query that works when I look at "FormA".
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
>>The Combo box is on a subform of Form A.
>>
>> SELECT Classes.ClassCode FROM Classes
>> WHERE ((Classes.EvCode)=Forms!FormA!EvCode)
>> ORDER BY Classes.ClassCode;
>>
>> When I then make Form A a subform of the Main form, the above query no
>> longer works.
>>
>> MainForm
>> FormA
>> SubForm
>>
>> I am not using a situation where there are two subforms of a main form,
>> which would look like:
>>
>> MainForm
>> Subform1
>> Subform2
>>
>> I never want to just look at FormA by itself. It should always be a
>> subform of the main form. I just noticed that it worked when it wasn't a
>> subform.
>>
>> How should I change the query to work when FormA is a subform.
>>

>
>



Reply With Quote
  #4 (permalink)  
Old 12-Nov-2005, 22:40 PM
Douglas J. Steele's Avatar Douglas J. Steele
Guest
 
Posts: n/a
   
   
Re: Lookup Querey within subform of a subform

It's quite unlikely that Subform is the correct keyword to use, unless
that's what you named the control. You need to determine the name of the
subform control in which FormA has been defined is named, and use that name.

Once you've got that control name correct, it's definitely Form, not FormA
that you want there.

As I indicated below, if you simply dragged FormA onto MainForm, the control
will likely be named FormA. If that's the case, you want:

WHERE ((Classes.EvCode)=Forms!MainForm!FormA.Form!EvCode )


You might find http://www.mvps.org/access/forms/frm0031.htm at "The Access
Web" to be a useful reference.


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Bob Richardson" wrote in message
news:as-dnR1ku-rkPOjeRVn-gQ@whidbeytel.com...
> Still have a problem. It's asking for the parameter value of the right
> side of the equation. Here's an exact copy:
>
> WHERE ((Classes.EvCode)=Forms!MainForm!Subform.FormA!EvC ode)
>
> I noticed in your reply that you used "Form!EvCode" I tried it that way
> and also "FormA!EvCode" but neither worked.
>
> "Douglas J. Steele" wrote in message
> news:eD3cApy5FHA.3984@TK2MSFTNGP10.phx.gbl...
>> WHERE ((Classes.EvCode)=Forms!MainForm!Subform.Form!EvCo de)
>>
>> "Subform" is the name of the contain where FormA resides on MainForm. If
>> you simply dragged FormA onto MainForm, it'll likely be named FormA, but
>> double check to be sure.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no e-mails, please!)
>>
>>
>>
>> "Bob Richardson" wrote in message
>> news:qbKdnZzJrstg2-jenZ2dnUVZ_t6dnZ2d@whidbeytel.com...
>>>I have a Combobox table lookup query that works when I look at "FormA".
>>>The Combo box is on a subform of Form A.
>>>
>>> SELECT Classes.ClassCode FROM Classes
>>> WHERE ((Classes.EvCode)=Forms!FormA!EvCode)
>>> ORDER BY Classes.ClassCode;
>>>
>>> When I then make Form A a subform of the Main form, the above query no
>>> longer works.
>>>
>>> MainForm
>>> FormA
>>> SubForm
>>>
>>> I am not using a situation where there are two subforms of a main form,
>>> which would look like:
>>>
>>> MainForm
>>> Subform1
>>> Subform2
>>>
>>> I never want to just look at FormA by itself. It should always be a
>>> subform of the main form. I just noticed that it worked when it wasn't a
>>> subform.
>>>
>>> How should I change the query to work when FormA is a subform.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
>>>

>>
>>

>
>



Reply With Quote
  #5 (permalink)  
Old 12-Nov-2005, 22:40 PM
Bob Richardson's Avatar Bob Richardson
Guest
 
Posts: n/a
   
   
More Query problems

This picture is worth 1,000 words!. I've just clicked the combo box "1St" in
the Class Choices subform. You can see the main form with it's subform,
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
EventSignUp, which also has a subform (sub2) called Class Choices. When I
enter "SW06" in the Parameter box, I get the correct result. I'm trying to
pick up "SW06" from the EventSignUp form. Something's wrong with my
RowSource Query.

http://www.pbase.com/image/52138756.jpg


Reply With Quote
  #6 (permalink)  
Old 13-Nov-2005, 17:32 PM
Douglas J. Steele's Avatar Douglas J. Steele
Guest
 
Posts: n/a
   
   
Re: More Query problems

Parent is a VBA concept, and SQL doesn't know anything about VBA.

Rather than Me.Parent!EvCode, you need to use the actual form name. Assuming
that EvCode is on the main form, you need Forms!!EvCode.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
If EvCode is on a subform, you need to use Forms!! of control containing the subform>.Form!EvCode

needs a little explanation.
Subforms don't actual exist on parent forms. Rather, there's a subform
control on the main form that's set to use whatever form you created to be
used as a subform. If you select a subform and look in the Properties box,
you'll see that there's a Name property and a Source Object property. The
Source Object is the name of the form that's being used as the subform. Now,
normally the Name property will also be the name of the subform, but not
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
always. It's whatever's in the Name property that you need to put where I
put above.

You may find http://www.mvps.org/access/forms/frm0031.htm at "The Access
Web" useful reading.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Bob Richardson" wrote in message
news:FqmdnWXGMfBqjuveRVn-gg@whidbeytel.com...
> This picture is worth 1,000 words!. I've just clicked the combo box "1St"
> in the Class Choices subform. You can see the main form with it's subform,
> EventSignUp, which also has a subform (sub2) called Class Choices. When I
> enter "SW06" in the Parameter box, I get the correct result. I'm trying to
> pick up "SW06" from the EventSignUp form. Something's wrong with my
> RowSource Query.
>
> http://www.pbase.com/image/52138756.jpg
>



Reply With Quote
  #7 (permalink)  
Old 13-Nov-2005, 17:33 PM
Bob Richardson's Avatar Bob Richardson
Guest
 
Posts: n/a
   
   
Re: More Query problems

  Donate Today!  
Thank you ENORMOUSLY! Yes, the name of the subform was slightly different.
The form name was EventSignUp, but the name of the subform control was
"Event Sign Up". The syntax seems a bit daunting but I hope I'm gradually
getting it. Thanks again.

"Douglas J. Steele" wrote in message
news:OWcqwu65FHA.3312@TK2MSFTNGP15.phx.gbl...
> Parent is a VBA concept, and SQL doesn't know anything about VBA.
>
> Rather than Me.Parent!EvCode, you need to use the actual form name.
> Assuming that EvCode is on the main form, you need Forms! > form>!EvCode. If EvCode is on a subform, you need to use Forms! > main form>!.Form!EvCode
>
> needs a little explanation.
> Subforms don't actual exist on parent forms. Rather, there's a subform
> control on the main form that's set to use whatever form you created to be
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
> used as a subform. If you select a subform and look in the Properties box,
> you'll see that there's a Name property and a Source Object property. The
> Source Object is the name of the form that's being used as the subform.
> Now, normally the Name property will also be the name of the subform, but
> not always. It's whatever's in the Name property that you need to put
> where I put above.
>
> You may find http://www.mvps.org/access/forms/frm0031.htm at "The Access
> Web" useful reading.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "Bob Richardson" wrote in message
> news:FqmdnWXGMfBqjuveRVn-gg@whidbeytel.com...
>> This picture is worth 1,000 words!. I've just clicked the combo box "1St"
>> in the Class Choices subform. You can see the main form with it's
>> subform, EventSignUp, which also has a subform (sub2) called Class
>> Choices. When I enter "SW06" in the Parameter box, I get the correct
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7260
>> result. I'm trying to pick up "SW06" from the EventSignUp form.
>> Something's wrong with my RowSource Query.
>>
>> http://www.pbase.com/image/52138756.jpg
>>

>
>



Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
Textbooks Spotted...
Today 12:51 PM
6 Replies, 80 Views
Do you believe in...
By akiva
Today 12:46 PM
174 Replies, 3,572 Views
Nitnem Gutka - Gurmukhi...
By Ishna
Today 12:27 PM
15 Replies, 16,383 Views
Poetry Corner
Today 12:13 PM
83 Replies, 9,583 Views
Map shows world's 'most...
Today 07:16 AM
13 Replies, 174 Views
Why are There so Many...
Today 06:19 AM
49 Replies, 4,812 Views
Learn Punjabi Yourself...
Today 05:41 AM
15 Replies, 7,614 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 05:32 AM
167 Replies, 4,297 Views
The Great Imp Debate
Today 05:28 AM
32 Replies, 489 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 05:16 AM
299 Replies, 7,381 Views
BHOOTS (Ghosts) and...
Today 04:22 AM
92 Replies, 13,728 Views
Thought of the Moment!
Today 04:01 AM
105 Replies, 4,992 Views
Panjabi
Today 02:14 AM
9 Replies, 206 Views
Fresno Sikh Who Was...
Today 01:30 AM
0 Replies, 47 Views
Guns of the Nihangs...
Today 01:24 AM
0 Replies, 49 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 13:14 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.50529 seconds with 32 queries
0