AfterUpdate Form Event Fires Repeatedly

I've been having this problem for a few months with a db I'm working on. I 
know there must be something simple I'm overlooking, so I'd greatly 
appreciate any help in identifying what the problem is.

I'm using the following to create a timestamp:

Me.dbLastUpdateUser = Forms!frmUserInfoHIDDEN!txtUserName
Me.dbLastUpdate = Now()

frmuserInfoHIDDEN refers to a form that is hidden on startup that stores the 
name the user logged in with. This feature works fine.

The AfterUpdate timestamp used to work as well. However, now it repeatedly 
fires and forces the user to stay on the current record. It won't go to the 
next or previous records, and inserts now() into the field each time I press 
the > or < buttons.

I started over with the form, so now the only event that I have is the 
AfterUpdate event. There are no OnCurrent events. 

Thanks in advance for any help you can offer! I know it must be some simple 
fix. (Note: I'm using Access 2003 for this project)
0
Utf
1/10/2008 8:56:02 PM
access.formscoding 7493 articles. 0 followers. Follow

6 Replies
514 Views

Similar Articles

[PageSpeed] 30

Hi Jenna,
How are using the timestamp in the after update event?
If your form for entering data is called frmA, I would think code like this 
would work

Private Sub Form_AfterUpdate()
    forms!frmUserInfoHidden!txtLastUpdate = Now()
End Sub

where txtLastUpdate is the name of the textbox for the date field called 
dbLastUpdate

Jeanette Cunningham


"Jenna B" <JennaB@discussions.microsoft.com> wrote in message 
news:AC604205-C066-4CAE-8F4C-D187ECEDA13D@microsoft.com...
> I've been having this problem for a few months with a db I'm working on. I
> know there must be something simple I'm overlooking, so I'd greatly
> appreciate any help in identifying what the problem is.
>
> I'm using the following to create a timestamp:
>
> Me.dbLastUpdateUser = Forms!frmUserInfoHIDDEN!txtUserName
> Me.dbLastUpdate = Now()
>
> frmuserInfoHIDDEN refers to a form that is hidden on startup that stores 
> the
> name the user logged in with. This feature works fine.
>
> The AfterUpdate timestamp used to work as well. However, now it repeatedly
> fires and forces the user to stay on the current record. It won't go to 
> the
> next or previous records, and inserts now() into the field each time I 
> press
> the > or < buttons.
>
> I started over with the form, so now the only event that I have is the
> AfterUpdate event. There are no OnCurrent events.
>
> Thanks in advance for any help you can offer! I know it must be some 
> simple
> fix. (Note: I'm using Access 2003 for this project) 


0
Jeanette
1/10/2008 9:38:22 PM
Any Timestamp code should be in a BEFORE Update event. If its placed in 
After Update, you create an endless loop:

Some change is made that will trigger an Update.
    AfterUpdate runs Timestamp. Timestamp updates the record, causing 
AfterUpdate to fire again,
         Timestamp updates,
                AfterUpdate fires,
                    Timestamp updates,
                        AfterUpdate fires,
                            Timestamp updates,
                                ... etc...

You'd never get off the record because the Update/AfterUpdate sequence never 
finishes.

-- 
HTH,
George

"Jenna B" <JennaB@discussions.microsoft.com> wrote in message 
news:AC604205-C066-4CAE-8F4C-D187ECEDA13D@microsoft.com...
> I've been having this problem for a few months with a db I'm working on. I
> know there must be something simple I'm overlooking, so I'd greatly
> appreciate any help in identifying what the problem is.
>
> I'm using the following to create a timestamp:
>
> Me.dbLastUpdateUser = Forms!frmUserInfoHIDDEN!txtUserName
> Me.dbLastUpdate = Now()
>
> frmuserInfoHIDDEN refers to a form that is hidden on startup that stores 
> the
> name the user logged in with. This feature works fine.
>
> The AfterUpdate timestamp used to work as well. However, now it repeatedly
> fires and forces the user to stay on the current record. It won't go to 
> the
> next or previous records, and inserts now() into the field each time I 
> press
> the > or < buttons.
>
> I started over with the form, so now the only event that I have is the
> AfterUpdate event. There are no OnCurrent events.
>
> Thanks in advance for any help you can offer! I know it must be some 
> simple
> fix. (Note: I'm using Access 2003 for this project) 


0
George
1/10/2008 9:41:50 PM
Jeanette,

Thanks for your reply. A few more details:

Yes, it is in an AfterUpdate event of my form.

There are two fields on frmA that need to be updated - the user who updated 
it and the date. 

A hidden form (frmUserInfoHIDDEN) contains the user name of the currently 
logged in user based on my login screen. So, I reference that for the 
dbLastUpdateUser field. 

There is no problem with the correct information being placed in either of 
those fields. On AfterUpdate they both display correctly the user name and 
date. However, the event continues to fire repeatedly when I attempt to 
navigate to another record. Example: it logs the current user as "jenna" and 
then successively logs the lastupdate field as "1-10-07 1:51:03am", "1-10-07 
1:51:05am", "1-10-07 1:51:07am" as I tried to advance to the next record. It 
wouldn't let me add a new record or delete the record either.

Side note: my mouse scroll bar doesn't work for advancing through records on 
this form and I don't have it disabled. I don't know if that is part of the 
same problem.

Thanks,

Jenna

"Jeanette Cunningham" wrote:

> Hi Jenna,
> How are using the timestamp in the after update event?
> If your form for entering data is called frmA, I would think code like this 
> would work
> 
> Private Sub Form_AfterUpdate()
>     forms!frmUserInfoHidden!txtLastUpdate = Now()
> End Sub
> 
> where txtLastUpdate is the name of the textbox for the date field called 
> dbLastUpdate
> 
> Jeanette Cunningham
> 
> 
> "Jenna B" <JennaB@discussions.microsoft.com> wrote in message 
> news:AC604205-C066-4CAE-8F4C-D187ECEDA13D@microsoft.com...
> > I've been having this problem for a few months with a db I'm working on. I
> > know there must be something simple I'm overlooking, so I'd greatly
> > appreciate any help in identifying what the problem is.
> >
> > I'm using the following to create a timestamp:
> >
> > Me.dbLastUpdateUser = Forms!frmUserInfoHIDDEN!txtUserName
> > Me.dbLastUpdate = Now()
> >
> > frmuserInfoHIDDEN refers to a form that is hidden on startup that stores 
> > the
> > name the user logged in with. This feature works fine.
> >
> > The AfterUpdate timestamp used to work as well. However, now it repeatedly
> > fires and forces the user to stay on the current record. It won't go to 
> > the
> > next or previous records, and inserts now() into the field each time I 
> > press
> > the > or < buttons.
> >
> > I started over with the form, so now the only event that I have is the
> > AfterUpdate event. There are no OnCurrent events.
> >
> > Thanks in advance for any help you can offer! I know it must be some 
> > simple
> > fix. (Note: I'm using Access 2003 for this project) 
> 
> 
> 
0
Utf
1/10/2008 9:54:04 PM
I knew it was something simple like that! Thanks so much George. 

I plan on avoiding endless loops in the future. :)

Thanks again for your quick response.

"George Nicholson" wrote:

> Any Timestamp code should be in a BEFORE Update event. If its placed in 
> After Update, you create an endless loop:
> 
> Some change is made that will trigger an Update.
>     AfterUpdate runs Timestamp. Timestamp updates the record, causing 
> AfterUpdate to fire again,
>          Timestamp updates,
>                 AfterUpdate fires,
>                     Timestamp updates,
>                         AfterUpdate fires,
>                             Timestamp updates,
>                                 ... etc...
> 
> You'd never get off the record because the Update/AfterUpdate sequence never 
> finishes.
> 
> -- 
> HTH,
> George
> 
> "Jenna B" <JennaB@discussions.microsoft.com> wrote in message 
> news:AC604205-C066-4CAE-8F4C-D187ECEDA13D@microsoft.com...
> > I've been having this problem for a few months with a db I'm working on. I
> > know there must be something simple I'm overlooking, so I'd greatly
> > appreciate any help in identifying what the problem is.
> >
> > I'm using the following to create a timestamp:
> >
> > Me.dbLastUpdateUser = Forms!frmUserInfoHIDDEN!txtUserName
> > Me.dbLastUpdate = Now()
> >
> > frmuserInfoHIDDEN refers to a form that is hidden on startup that stores 
> > the
> > name the user logged in with. This feature works fine.
> >
> > The AfterUpdate timestamp used to work as well. However, now it repeatedly
> > fires and forces the user to stay on the current record. It won't go to 
> > the
> > next or previous records, and inserts now() into the field each time I 
> > press
> > the > or < buttons.
> >
> > I started over with the form, so now the only event that I have is the
> > AfterUpdate event. There are no OnCurrent events.
> >
> > Thanks in advance for any help you can offer! I know it must be some 
> > simple
> > fix. (Note: I'm using Access 2003 for this project) 
> 
> 
> 
0
Utf
1/10/2008 10:02:01 PM
Side note: apparently the mouse scroll to navigate records in a form in 
Access 2007 is disabled. (I'm using 2007 at the moment, working on my 2003 
db.) 

Access does scroll in continuous and datasheet views though.

Reference: http://allenbrowne.com/Access2007.html

"Jenna B" wrote:

> I've been having this problem for a few months with a db I'm working on. I 
> know there must be something simple I'm overlooking, so I'd greatly 
> appreciate any help in identifying what the problem is.
> 
> I'm using the following to create a timestamp:
> 
> Me.dbLastUpdateUser = Forms!frmUserInfoHIDDEN!txtUserName
> Me.dbLastUpdate = Now()
> 
> frmuserInfoHIDDEN refers to a form that is hidden on startup that stores the 
> name the user logged in with. This feature works fine.
> 
> The AfterUpdate timestamp used to work as well. However, now it repeatedly 
> fires and forces the user to stay on the current record. It won't go to the 
> next or previous records, and inserts now() into the field each time I press 
> the > or < buttons.
> 
> I started over with the form, so now the only event that I have is the 
> AfterUpdate event. There are no OnCurrent events. 
> 
> Thanks in advance for any help you can offer! I know it must be some simple 
> fix. (Note: I'm using Access 2003 for this project)
0
Utf
1/10/2008 10:13:03 PM
On Thu, 10 Jan 2008 14:02:01 -0800, Jenna B <JennaB@discussions.microsoft.com>
wrote:

>I knew it was something simple like that! Thanks so much George. 
>
>I plan on avoiding endless loops in the future. :)

Recursion, n. See: Recursion.

- The Programmer's Dictionary

             John W. Vinson [MVP]
0
John
1/11/2008 12:07:13 AM
Reply:

Similar Artilces:

Events, dear boy, events #2
Hi Bob Yes I'm certain. I'm right-clicking the worksheet tab to view th sheet's code page, then pasting the in the event code.. -- Gromi ----------------------------------------------------------------------- Gromit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=92 View this thread: http://www.excelforum.com/showthread.php?threadid=27721 ...

OWA Forms stops working
Exchange 2003 SP2 I have forms enabled but about once a day the forms stop working and instend the popup box aksing for user name and password comes up. Restarting the IISADMIN service fixes it but I can't find any errors in the event log. Have anyone seen this before or have any ideas? Thanks ...

Modal Form from a child form
Hi, I have a little problem, I have a MDI form (Main Menu), this form open a child form (A), and I need to open a form B as modal form from form A. I can to this with showDialog(), but it open form B outside MDI form (Main Menu) and it is showed on the windows bar as another application opened. So the question is, there are any way to open a modal form from a child form inside a MDI form? Thanks El Alquimista wrote: > Hi, I have a little problem, I have a MDI form (Main Menu), this form > open a child form (A), and I need to open a form B as modal form from > form A. I c...

automatically get an alert when someone adds an event to public Calendar?
Is there a way to automatically get an alert when someone adds an event to a public Calendar? Having the person who added the event send me an invite is not an option, because they will not do this. (I am required to check the calendar to see if any events have been added.) I can't see a way to quickly see what new events have been added so I have to check the whole calendar. (Or is there a way to view events by the date they were added, not the date of the event?) TJ There should be some solutions for this at = http://www.slipstick.com/addins/notify.htm=20 --=20 Sue Mosher, Outlook...

Simple data form
Hi, I'm creating a Shipping template in Excel, and I want a simple form to pop up for the line items. I can see how to do it using Data/Form, however is there another way to do it, by not making the user do that? Maybe so the form opens up when they get on the first cell of that part of the worksheet? Also I noticed when I do use this form, when I close it, it doesn't bring me back to the worksheet, but rather to the VB code. I don't want this to happen to my users. Any ideas? Thanks! Tracey:mad: ------------------------------------------------ ~~ Message posted from http:/...

Slow Closing of Form
Environment: 1. Front-End - MS Access 2003 2. Back-End - SQL Server 2005 3. OS - Windows XP I cannot understand why it takes a 5-7 seconds to close our Invoice form. The Invoice form has several data components in it that retrieves data. The code in the "Done" button of the form perform the following: a. Me.Requery b. Check other loaded forms "IsLoaded()" c. DoCmd.Close The form has also a code in the "Close" event which only checks for loaded forms again "IsLoaded()". Thanks, Ben Check to make sure that you aren't saving any f...

Calendar items "disappear" with Event id 8206, 8239, 8241
Dear all I am using outlook xp with windows2k, share a calendar with other staffs. "one of them will syn the calendar with the PPC". Now some of my calendar items disappear after a while. They are still there but the stat/end dates are lost I can still see them if I do an "advanced find" under my calendar items and search for all items. They appear in the list with no start or end date. And it occurs randomly. Thanks for support. KL "Kenny" <Kenny@discussions.microsoft.com> wrote: >I am using outlook xp with windows2k, share a calendar with oth...

Create a copy of a form and link the entire form to a new datasour
Hi I have two surveys: the initial survey and a post survey. The Post survey includes all the questions in the initial survey as well as new questions. I want to save time in creating forms. How can I make a copy of the initial survey form and call it "Post" and add my new questions but change the source to my "Post" table without recreating the entire form? Thank you in advance. You change the recordsource of the second form. You can use a single form and change the recordsource on the fly. Just add a button to the form to change the recordsource...

Form won't open anymore
I was working on a form in design view and was adding a subform. When I finished the wizard I resized and repositioned it and clicked save. A message box came up saying "There is not enough memory to perform this operation. Close all other programs and try again" I did this but still the same message. The only way out of it was closing the form without saving it. Now when I try to open the form it doesn't open in either design view or normal view. When I try to open it from my menu with a button I get the runtime message 2001 "You cancelled the previous operati...

Form freezes
the logic is like that, I have 4 queries, each query performs a diffirent calculation from different tables each query have been called using the example down. ''q1 sslt_trnsfin = Nz(DLookup("Total_trns_volume", "Q_trnsf_in"), 0) slt_trnsfin = sslt_trnsfin ''q2 sslt_trnsfin2 = Nz(DLookup("Total_trns_volume2", "Q_trnsf_in2"), 0) slt_trnsfin2 = sslt_trnsfin2 ''q3 sslt_trnsfin3 = Nz(DLookup("Total_trns_volume3", "Q_trnsf_in3"), 0) slt_trnsfin3= sslt_trnsfin3 and so on i tried to put some text box within the for...

Hyperlink on forms
I have a silly problem which is baffling me. I have two forms - one single form view, one continuous forms view. The single form has a tab control. I have a hyperlink text box control on the continuous form and an identical one on the tab control of the single form. The hyperlink on the tab control only works if the sub-menu item "Hyperlink > Open Hyperlink" is used. If I click on the control, the system inserts a "#" before and after the url and then does nothing else. If I put the text box control in an area of the form outside of the tab control,...

Multiple Order Forms
Hi I am in the process of customizing CRM and was wondering if it's possible to create multiple order forms. Example... Different order forms based on different products as the order information will change. Thanks in advance for any advice. Jason Jason, There is no way of doing this with the standard client. The only option for you is to customize the order system with your own ASP application. Stephen "Jason" <Jason@discussions.microsoft.com> wrote in message news:7CB3367D-787E-493F-B904-FEED152D34D0@microsoft.com... > Hi > > I am in the process of c...

AfterUpdate/BeforeUpdate and SetFocus
I have some problems with the SetFocus command in a Userform with an AfterUpdate or BeforeUpdate routine. To make it clear to you, I made a very small Userform to demonstrate it. It only contains 8 TextBoxes and this code: Code: Private Sub TextBox01_AfterUpdate() Me.TextBox08.SetFocus End Sub - Private Sub TextBox02_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean) TextBox08.SetFocus End Sub - Private Sub TextBox03_Exit(ByVal Cancel As MSForms.ReturnBoolean) TextBox08.SetFocus End Sub - Private Sub TextBox04_Change() TextBox08.SetFocus End Sub I expected that in ...

The custom form could not be opened.
In Business Contacts, I get the message: "The custom form could not be opened." on a nearly daily basis ... it then goes on to say: "Array index out of bounds." I can go in, clear the cache on "custom forms" in the business manager, and the problem goes away, but it comes back again soon for no apparent reason ... anyone know how to stop this? have you tried deleting the frmcache.dat file, along all the form "folders" in that same directory? "Angie" <anonymous@discussions.microsoft.com> wrote in message news:cc1f01c4391a$7c4eab...

Forms Problem
Hi everybody, i am having this problem: There was a programmer that made an access aplication with VB Modules, forms, an so on (With Spanish Office 2000), and now the organization change all the aplications to English versions (including Office 2K). The problem is that when i run the access app (With English version of Office 2k) and click on any button, i get this error : Microsoft Office Access can't find the macro 'procedimiento de evento' But when i run de app with Spanish version of Office 2k (in other computer) there is NO problem with the app and works well. Any i...

Checking for opened form
Hi How can I check if a form is already open? Thanks Regards John, This always woks for me... In a module... (TIP: Do NOT name the module IsLoaded!) Function IsLoaded(ByVal strFormName As String) As Boolean ' Returns True if the specified form is open in Form view or Datasheet view. Const conObjStateClosed = 0 Const conDesignView = 0 If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then If Forms(strFormName).CurrentView <> conDesignView Then IsLoaded = True End If End If End Function Then p...

CScrollbar events in VS 2003
I've added a scroll bar to a dialog in a new dialog only mfc app. but the only event I can find for it is NM_THEMECHANGED (which throws a compiler error)? Can I add my own WM_SCROLL handlers? Thanks ...

one label all forms
I want to put a label on all my forms that says YOU ARE IN ARCHIVE. Can I do this without placing a label on each form? Thanks. You could set the form's Caption to that. That would mean that it would appear in the bar at the top of the form. However, you'd have to set it, so I don't know whether that'll save you anything. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "seeker" <seeker@discussions.microsoft.com> wrote in message news:E4FC21F1-32F8-4A6E-A33B-EC9B18F9617D@microsoft.com... >I want...

Linked form can't be edited
I have a large table with contact details and also additional details which only relates to about a third of my clients. If I include all the fields in my main input form(1) it becomes very cluttered so I have created another form(2) for just the additional information and select it with a button from form(1). Form(2) is filtered according to the client in form(1). However even though I have enabled editing in the properties box, I am unable to edit the form(2) fields. Without the filter it works fine, but I have to find the client manually to add the additional information. What...

AfterUpdate
Hello Chaps, In the AfterUpdate code I had the detail back colour change if a check box (tbc) = True. However if I tick the box now it turns the back colour of every form irrespective if that record is ticked tbc or not! Any help on solving this would be great. JAMES Private Sub tbc_afterupdate() If Me.tbc = True Then Me.Section(0).BackColor = 65535 Else Me.Section(0).BackColor = 16777215 End If End Sub If you are using a continuous form, that code won't work. The good news is that you can use Conditional Formatting to make it work. In Design View, select the combo box and fro...

Reservation Form
I have an active website for my business. I built it in Frontpage 2002. It no longer will send email through the settings I used ( Reservation form) and I cannot get it to take any of the settings I give it. I do not think that my knowledge is sufisticated enough. And, I don't think that I am entering the information completely enough. I am using a simple form with a single enter button. Can you help? May be possible. -- ~~~~~~~~~~~~~~~~~~ Rob Giordano Microsoft MVP Expression Web "FrontPage 2002 on windows XP" <FrontPage200...

Worksheet_Calculate code in same module as Worksheet Change event goes astray
Hi, I'm trying to get some code to fire, based on a formula in cell E2 changing value to equal 1. Private Sub Worksheet_Calculate() If Cells(5, 2) = 1 Then MsgBox "Fires ok" 'Application.EnableEvents = False End Sub I can get it to work properly on a blank spreadsheet. However I need to use it on a worksheet that already has a Worksheet Change code. Since it seems like each worksheet can only have one module (page? not sure of the right name) for code, the above code is in the same module as the Change code. Thus, when the entry is made that chang...

Auto populate a form form an open form
Hi I have a main form with customer names and addresses and would like to add a control button on this form which opens up another form which is used for recording telephone calls on. What I have been trying to do is auto populate this call log form with information from the main form ie name and address? Any thoughts Thanks Chris Chris, Please don't re-post the same question twice. You have to be patient and wait for a reply. Responders are volunteers, and you may not get an answer right away. Posting twice causes some people to respond to the first post, while others are ...

copy properties Under forms
Hi, I'm wondering if someone can help me with something on copying properties. I've checked the access help but can't find anything there. This is what i want to do. I'm copying text boxes, labels that has caption, name and other information in the properties that i want to keep when i copy the information to another tab on a form. Is there a way i can copy the property information without doing alot of manual work by going into each text or label box. I hope this makes sense. thanks for you help in advance. Keith When you copy a control, everything about the cop...

form pozition on screen
I would like to find form position on screen. It's similar to DoCmd.movesize, but I want discover "parameters' for form position (left corner, top corner, etc) Are you saying that you want to find out what the current position IS? If so, you can use something like this: MyFormLeftVariable = Me.Left MyFormTopVariable = Me.Top MsgBox "My Form is at " & MyFormLeftVariable & VbCrLf & MyFormTopVariable Or however you want to use it. -- Bob Larson Access World Forums Super Moderator Utter Access VIP Tutorials at http://www.btabdevelopment.com ___________...