Thanks Mike
Here's a more thorough explanation. I posted it under another thread based
on another approach someone told me.
I have a query by form that returns a record set in a datasheet. The user
double clicks on a row and a main form (pop up) opens bound to a table with
a continuous subform bound to another table.
On the main form is a field called [Status]. It is vital that this is
always populated with the value from a field [CommStatus] in the most recent
record on the subform. The subform table has a primary key [CommID] as well
as a date/time stamp field. Because a user can delete subform records and
add to them, I need that main form field [Status] to always have the value
from the most recent subform record, which means the highest CommID or most
recent date and time. The users move frequently from next record to
previous record of the recordset while on the main form, adding and deleting
subform records.
I've tried code in the OnCurrent event of the main form to get the value.
This works if I close the form and reopen it because the subform is set to
go to the last record . But if the user clicks next record, then goes back
it doesn't update. I've tried setting the OnCurrent event of the subform to
go to the last record but this seems to freeze the new record area of the
subform. I've tried using refresh in the after update event of the subform
and that didn't work either.
I'm playing around with using a DMax statement in an unbound text box on the
subform to return the highest CommID then somehow refer to it in the
OnCurrent event of the main form...but I'm still open to all suggestions!
William
"Mike Storr" <st******@sympatico.ca> wrote in message
news:w8**************************@40tude.net...
On Thu, 29 Jan 2004 15:24:49 -0500, William Wisnieski wrote:
I used Me.Parent.Refresh in the subform. The main form control is bound
to one of the fields in the table the form uses.
"Mike Storr" <no****@somewhere.con> wrote in message
news:5i*******************@news20.bellglobal.com.. .
I re-read your original posting and I beleive that I misunderstood it at
first. However, I'm having some trouble envisioning the way you have
things setup, so some more info about how the forms are linked to each other, and
perhaps a brief example of the table/query you are using to do this would
help?
--
Mike Storr
veraccess.com