Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 15th, 2007, 12:54 PM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to scandalous Send a message via MSN to scandalous
Default Referencing a subform

I have a form named invoice

it has 2 subforms on it

the first subform is a data sheet with 2 fields quote and job- combo boxes

the second one is a date sheet is based on a query that calculates the sum of the job

What i am trying to do is reference the quote and job in subform 1 and have it populate as it is selected

I have Criteria on the query for the second form as

[Forms]![Subform1]![Quote] - for quote
[Forms]![Subform1]![Job] - for job

but i think i need to first reference the the main form how would i do that

or am i trying to do something thats not possible?

 
Old March 15th, 2007, 02:28 PM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 163
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You are trying to populate a textbox called My_Text in subform2 based on values in combos on subform1?
Let's assume you're trying to concatenate the two into a text box on subform2. First name the combo box different from it's row source. Quote_Combo and Job_Combo would be good choices.

Assuming both forms are running AND you're coding from within the combo's afterupdate in Subform1:
-------------------------------------------------------------------------------------------------------
Forms("Subform2").My_Text.Value = "For Job " & Job_Combo.Value & vbCrLf & "Quote: " & Quote_Combo.Value
-------------------------------------------------------------------------------------------------------

Hope this answers your question or points you in the correct direction.

 
Old March 16th, 2007, 07:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

If you're in the second subform and you want to reference a control in the first, you need this structure.

Me.Parent.Form.SubForm1Name.Form.ControlName

So in your case

Me.Parent.Form.SubForm1.Form.Quote


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
referencing html... Jayahar ASP.NET 3.5 Basics 1 September 2nd, 2008 10:41 PM
Referencing new node in IE roccosiffredi Ajax 2 May 4th, 2007 03:30 AM
Referencing another field and more scandalous Access VBA 1 January 30th, 2007 09:28 AM
Filter Subform B Based on Field in Subform A SerranoG Access VBA 3 June 18th, 2004 12:23 AM
referencing a subform, more complex than it sounds nimarii Access 1 February 11th, 2004 06:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.