[AccessD] Form as Subform - Query Fails - Why?

John Ruff papparuff at comcast.net
Sat Jan 3 06:20:53 CST 2004


There are a couple of methods o set values on a main form (Independent form
as you call it) from a subform)

' The txtDate is the name of the object in the subform that sets the date

1. Forms!NameOfIndependentForm!txtFromDate=txtDate 
2. Parent!txtFromDate=txtDate

I prefer the 2nd method myself.


John V. Ruff - The Eternal Optimist :-) 

"Commit to the Lord whatever you do, 
                and your plans will succeed." Proverbs 16:3 



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tina Norris
Fields
Sent: Saturday, January 03, 2004 1:44 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Form as Subform - Query Fails - Why?


Hi,

Probably I am missing something but I don't understand why this bright 
idea of mine didn't work.  Here's the picture:

I have a little calendar form with textboxes BeginningDate and 
EndingDate.  I have a little parameter query that uses a date range set 
Between BeginningDate And EndingDate to select the appropriate records.  
The query creates a table of records of people who have made 
contributions within the date range.  This table is the data source for 
a Word document, the acknowledgement letter.

I thought I'd be really clever and make a form with instructions - 
"select the beginning and ending dates on this calendar"   "click this 
button to create the acknowledgement table" etc.  So, I plugged the 
calendar form in as a subform on this clever instruction form, rather 
than popping open the calendar form.  Setting the beginning and ending 
dates in the calendar, once it was a subform, did not provide the query 
with its parameters.  

I played around with setting the dates on the calendar-form-as-subform, 
then opening the calendar form independently - the dates were not set in 
the independent form, only in the subform.  So, clearly, the instance of 
the calendar-form-as-subform to the instruction form is a new beast - 
sort of.  Making design changes to the calendar-form-as-subform, such as 
background color, applies those changes to the independent calendar 
form.  But, setting textbox values from within the 
calendar-form-as-subform does not set those values in the independent 
form.  Do I really have two beasties here?  If so, why can I not find a 
way to identify the textboxes in the subform so my query can use them?

It looked like such a nice idea!  What am I doing wrong?

Thanks,
Tina





_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list