From: DT on
I have a main form with lots of data and a "time-stamp" (TS) field. There is
a popup form with more data on it that is Parent-child linked to the main
form. When ANY field is modified (pop-up or main form), I have an
"After-update" event that updates the TS. My problem is that once the TS
update occurrs, I can't move to the next record. I first have to close the
form and open it again.

I've tried Me.Dirty=False on the forms, and it complains that it can't
update it. I also tried Me.Refresh. That doesn't seem to work either. I'll be
trying both again with more scenarios, but if someone has some experience
with this issue that they can enlighten me with, it would be extremely
helpful. I've wasted WAY to many hours on this seemingly simple issue... =\

Thank you!

--
DT
From: BruceM via AccessMonster.com on
If you can't update the record there is a problem that probably won't be
solved by closing and reopening the form. If the form and subform are based
on queries, can you edit the query directly? If so, what is the code you are
using to update the TS field, and what event are you using to update it. If
it is the After Update event, it needs to be the After Update event for each
control, not for the form. The After Update event for the form occurs after
the record has been saved, so it can't be used to insert a value into the
record that was just updated. The form's Before Update event runs only when
the data in the record have been changed, so that is the place to update TS.

DT wrote:
>I have a main form with lots of data and a "time-stamp" (TS) field. There is
>a popup form with more data on it that is Parent-child linked to the main
>form. When ANY field is modified (pop-up or main form), I have an
>"After-update" event that updates the TS. My problem is that once the TS
>update occurrs, I can't move to the next record. I first have to close the
>form and open it again.
>
>I've tried Me.Dirty=False on the forms, and it complains that it can't
>update it. I also tried Me.Refresh. That doesn't seem to work either. I'll be
>trying both again with more scenarios, but if someone has some experience
>with this issue that they can enlighten me with, it would be extremely
>helpful. I've wasted WAY to many hours on this seemingly simple issue... =\
>
>Thank you!
>

--
Message posted via http://www.accessmonster.com

From: Daryl S on
DT -

When you update the TS, are you updating the value on the main form, or are
you updating the database with a SQL update query?

If you are updating the value on the main form, then you need to save the
record. If you are on the subform, and you update the parent form field,
then you need to save the parent record. Me.Dirty=False works on the current
form, so if you are on the subform, that would try to save the subform, not
the parent form. You would want Me.Parent.Dirty=False.

If you are updating the value in the database, then the main form is out of
sync with the database, and you would need to requery the main form (not the
subform).

If you are still struggling, show us the code that updates the TS, and tell
us what errors / messages you get when you try to move records.

--
Daryl S


"DT" wrote:

> I have a main form with lots of data and a "time-stamp" (TS) field. There is
> a popup form with more data on it that is Parent-child linked to the main
> form. When ANY field is modified (pop-up or main form), I have an
> "After-update" event that updates the TS. My problem is that once the TS
> update occurrs, I can't move to the next record. I first have to close the
> form and open it again.
>
> I've tried Me.Dirty=False on the forms, and it complains that it can't
> update it. I also tried Me.Refresh. That doesn't seem to work either. I'll be
> trying both again with more scenarios, but if someone has some experience
> with this issue that they can enlighten me with, it would be extremely
> helpful. I've wasted WAY to many hours on this seemingly simple issue... =\
>
> Thank you!
>
> --
> DT
From: BruceM via AccessMonster.com on
If you are in the subform, the parent record has already been saved. If the
parent record is updated from the subform by an Update query or some such the
parent form would not be dirtied, so there would be nothing to gain by Me.
Parent.Dirty = False as far as I can see.

Daryl S wrote:
>DT -
>
>When you update the TS, are you updating the value on the main form, or are
>you updating the database with a SQL update query?
>
>If you are updating the value on the main form, then you need to save the
>record. If you are on the subform, and you update the parent form field,
>then you need to save the parent record. Me.Dirty=False works on the current
>form, so if you are on the subform, that would try to save the subform, not
>the parent form. You would want Me.Parent.Dirty=False.
>
>If you are updating the value in the database, then the main form is out of
>sync with the database, and you would need to requery the main form (not the
>subform).
>
>If you are still struggling, show us the code that updates the TS, and tell
>us what errors / messages you get when you try to move records.
>
>> I have a main form with lots of data and a "time-stamp" (TS) field. There is
>> a popup form with more data on it that is Parent-child linked to the main
>[quoted text clipped - 10 lines]
>>
>> Thank you!

--
Message posted via http://www.accessmonster.com

 | 
Pages: 1
Prev: Default Value on Form Help
Next: Change form size