Hi again,
I am trying to help with an inherited mess.
Form is “Table1”
Record source for the form is a table also named “Table1”
There is a table included at the bottom of form Table1: Object source is “Table.Donation”
Table.Donation is linked to the record source Table1 by field “SER_NUM”
Table.Donation includes several fields, the one I need is “DepDate”
There is a button on the form that opens a report “RptIndividualDonarRcpt”
The record source for the report is: “Qry_PRINT_INDIVIDUAL_Donation_REPORT”
The query has a parameter for DepDate, prompting the user to enter the date (##/##/####) of the record to include in the report.
Is it possible to select the desired record in Table.Donation and have DepDate value for that record pass directly to the query so a date doesn’t have to be manually entered?
Hopefully this makes some sense. Rebuilding the DB isn’t an option at this time.
Thank you for any assistance.
-Scott
Pass date value from subtable to query
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Pass date value from subtable to query
Think this might work. Changed the DepDate parameter to [Forms]![Table1]![Child42].[Form]![DepDate].
I'll update if it does to close.
Thanks.
I'll update if it does to close.
Thanks.
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Pass date value from subtable to query
It works but when I try to run another record it retains the previously selected records DepDate. If I close the form and reopen it all is well. Is there a way to "clear" the previous DepDate value?
Thank you!
Thank you!
-
- Administrator
- Posts: 79419
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Pass date value from subtable to query
Yes. I have DoCmd.Close acReport, sExistingReportName
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Pass date value from subtable to query
The report isn't showing as open but when I select another record and run again it appears as though it never closed.
-
- Administrator
- Posts: 79419
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Pass date value from subtable to query
Without seeing the database it's impossible for me to know what causes the problem.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Pass date value from subtable to query
I will strip down a version and attach. Thanks Hans.
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Pass date value from subtable to query
I figured it out. I was seeing this when I was exiting out of the sendobject procedure. I moved the close report code to after the error handling and now everything is working. Thanks again for all the help.
-
- Administrator
- Posts: 79419
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Pass date value from subtable to query
Perhaps Error in Access when opening a database on a network file share is related to your problems.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 402
- Joined: 14 Apr 2010, 15:59
Re: Pass date value from subtable to query
Good article and thank you for sharing but not related. Working on a db used on a stand alone pc. Thank you Hans.