A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Form doesn't move to next record after update



 
 
Thread Tools Display Modes
  #1  
Old April 30th, 2010, 04:11 PM posted to microsoft.public.access.forms
DT
external usenet poster
 
Posts: 45
Default Form doesn't move to next record after update

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
  #2  
Old April 30th, 2010, 04:26 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Form doesn't move to next record after update

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

  #3  
Old April 30th, 2010, 04:51 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Form doesn't move to next record after update

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

  #4  
Old April 30th, 2010, 05:51 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Form doesn't move to next record after update

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.