Duane,
Sorry, I should have noted that I did try the "me." format first and got the
same "null" error, the [report] format was just the last variant I tried. The
inital code was
Cancel = (Me.LastStatusRecord <> Me.Status_id)
where the LastStatusRecord is the Max(status_id) of the child record for the
parent and status_id is the detail control.
Duane Hookom said:
Why are you using the syntax "[reports]![reportname]![reportcontrol]"? I had
expected you to modify
Cancel = (Me.DetailControl <> Me.txtGroupHeaderControl)
with your actual control names.
--
Duane Hookom
Microsoft Access MVP
:
Duane,
I keep getting a run time erro 94, invalid use of null ib both controls
referenced on the "cancel" statement. If I run without the cancel, the values
of the controls display (for debugging purposes) as expected. I'm
referencing them directly via [reports]![reportname]![reportcontrol].
:
Thanks Duane. I'll give that a shot.
Dan
:
You place a text box in the group header that is bound to Max(...) which
would identify the "last" record. Then in the On Format event of the detail
section, use code like:
Cancel = (Me.DetailControl <> Me.txtGroupHeaderControl)
--
Duane Hookom
Microsoft Access MVP
:
i have two tables defined with a 1-to-many relationsship. One of the reports
I need to generate consists of data from each parent record and only the most
recent "child" entry (per parent). How can I filter to the children to just
include this "last" record?
Thanks in advance,
Dan