Sounds like the subform control name is not the same as the name of the
form loaded into it (its SourceObject.)
Open the main form in design view.
Right-click the edge of the subform control, and choose Properties.
Look at the Name property of the subform control.
(The title of the properties box must read 'Subform/subreport', or you
are not looking at the right thing.)
The funny thing is that when I use the subform solely the query works
fine (subform sfrmProdTotDag on frmProdTotDag with
[Forms]![frmProdTotDag]![txtStartDate] as criteria in the query) but
when I put the frmProdTotDag as a subform on frmProdTot and change the
criteria in the same query to
[Forms]![frmProdTot].[form]![frmProdTotDag].[txtStartDate], it doesn't
give any result and is showing the parameter dialog.
This is the SQL in the first case:
SELECT qryRptProdPersSumList.datum, qryRptProdPersSumList.Afdeling,
Avg(qryRptProdPersSumList.Percentage) AS AvgOfPercentage
FROM qryRptProdPersSumList
GROUP BY qryRptProdPersSumList.datum, qryRptProdPersSumList.Afdeling
HAVING
(((qryRptProdPersSumList.datum)=[Forms]![frmProdTotDag]![txtStartDate]));
And this is the SQL in the second case:
SELECT qryRptProdPersSumList.datum, qryRptProdPersSumList.Afdeling,
Avg(qryRptProdPersSumList.Percentage) AS AvgOfPercentage
FROM qryRptProdPersSumList
GROUP BY qryRptProdPersSumList.datum, qryRptProdPersSumList.Afdeling
HAVING
(((qryRptProdPersSumList.datum)=[Forms]![frmProdTot]![frmProdTotDag].[Form]![txtStartDate]));
For me everything looks OK, but it doesn't work.
Chris
"Allen Browne" <
[email protected]> schreef in bericht
The parameter dialog indicates that Access can't find the name you
specified. Assuming the form is open, the most likely cause is that
the name does not match exactly - either in the criteria, or in the
Parameters clause of the query.
Regarding the bizzare behavior, you might like to follow the steps
here:
Recovery sequence - Standard steps to recover a database
at:
http://allenbrowne.com/recover.html
The Name AutoCorrect issues could be the cause. Complete at least the
first 3 steps.
Allen,
I changed the Choose... thing and it works fine now. Bizar though.
I'm taking a bit of advantage of the situation but in another
database I have a problem referencing to the TxtStartDate field. This
field is on a subform on a tab in a main form.
I tried as a criteria in a query
[Forms]![frmProdTot].[form]![frmProdTotDag].[txtStartDate] where
frmProdTot is the main form (unbound), frmProdTotDag is the subform
(unbound). The results of the query should be shown in a subsubform
on the frmProdTotDag subform.
When I open the frmProdTot form I get a popup window asking me to
enter the parameter value (date).
Any suggestions?
Thanks,
Chris
"Allen Browne" <
[email protected]> schreef in bericht
Chris, I assume we are talking about this popup calendar:
http://allenbrowne.com/ser-51.html
I can't imagine what's gone wrong here. Perhaps you could change
tgeh message as well, so it says:
=CalendarFor([ExecDate];"Choose an Exec date.")
Then look in the Title bar of the calendar to see which control it
will write to.
You should be able to open only one calendar at a time (modally), so
the target should not change.
Hi,
This is the situation:
I have subform with three date fields (ContactDate, DueDate and
ExecDate). Dates are chosen by Allen Browne's Date Picker.
Each date field has a Date Picker button next to it. On the OnClick
event of each Date Picker button the according field is filled:
=CalendarFor([ContactDate];"Choose a date.")
=CalendarFor([DueDate];"Choose a date.")
=CalendarFor([ExecDate];"Choose a date.")
This works fine if I start the input at the first field
(ContactDate). It should however be possible to change any of the
other two dates on the subform without passing by the ContactDate.
But when I click on the ExecDate button, the ContactDate changes.
The same thing happens when I click the DueDate button (ContactDate
is changed).