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
830 Views

Similar Articles

[PageSpeed] 25

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:

OnLoad form position
While using CRM, I have created a number of custom entities. I know how to set the size using an onLoad script, but is there any way to move the for so that it opens and the user can see everything on the page, rather than opening so that half of the form is off-screen? Any ideas would be greatly appreciated. ...

How do I store calculations from a form to a database table?
My boss and I are stuck trying to figure out how to make our calculations be stored in our database table. Currently our calculations are in the design view of the form. We are able to see the anwer to the calculations, but they are not stored in the database table. What are we doing incorrectly? Is there some other place or way that we are supposed to do calculations? Thank you for your help. The short answer is - don't. In most cases you should not try to store calculated values in a table. Calculations should be done in queries or in unbound controls on forms. Storing the value ...

Events from CHtmlView
If a browser control CHtmlView is embeded in an MFC application, is it possible for the MFC application to get events (e.g., a button click on the HTML page) and other form information from the HTML page ? Vinodh I am not sure about CHtmlView. But this can be done on CHTMLDialog using DECLARE_DHTML_EVENT_MAP. Check the Documentation The other way is a do it the painfull way where you can get the IHTMLDocument object from the webbrowser and search for the individual elements and advise for them for all the events you want. -- ------------------------------ Ashok K Kumar -----------------...

Custom Forms #2
Hi, I'm wondering is it possible to have mail in a public folder be converted a form in Exchange 2003? (e.g., any reply/forward/double click/right click). Or new mail composed in that folder be converted to forms? If so what tools do I need to consider? Regards, Norman Zhang ...

Naming a subform from a main form
I'm having a heck of a time getting to a control on a sub form from a main form. I use the following convention Forms![frm MAIN_FORM]![frm SUB_FORM]![CONTROL_NAME] However when I run the code, I get an error message informing me Access cannot find the field named [frm SUB_FORM]. Then I tried taking the mainform out of the line leaving me with Forms![frm SUB-FORM]![CONTROL_NAME] Then the message reads can find find the form named frm subform. As far as I can tell the subform is opened. I can see it. I'm baffled. Can you help me? Common problem!! Open your main form in d...

Checking a forms fields for null
Hi All, I can think of a few ways to accomplish this, but would like to know of a better way. just like when you fill out forms on the web if the field is mandatory it pops up a msg say somthing like "This field isn't optional" if it is left blank. What is the best way to do this in access on a form? I'm using now: if ISNull(myFeild1) then msgbox"Please fill in myFeild1" end if If ISNull(myFeild2) then msgbox"Please fill in myFeild2" end if if ISNull(myFeild3) then msgbox"Please fill in myFeild3" end if I use s...

Display a PDF in a Windows Form.
I've got a kiosk program that displays information that runs unattended. I need to have the ability to put PDF up on the screen. I have other stuff on the screen that needs to still be displayed. Adobe opens as a new window with menus and whatnot so this is not acceptable. Does anybody know of a way to display a PDF in a winform? I don't need any of the menus or stuff like that - just display the pdf. It would also be nice if I could programmatically control what page it's displaying so I could display multiple pages in succession. TIA - Jeff. "Mr. ...

Dynamically linking fields to forms
In my form I have patient_Id as drop down list which is linked to main PATIENT table where it gets update by different department and the new values shows up in my FORM's drown drop list immediately. Along with patient_id I have 4 more values that need to be shown on my FORM from 4 different tables. Finally all the above values collected dynamically and some tested values from FORM base table ( testing table) should be saved into my testing table when some one clicks on the save button. Is this possible? with out distrubing the PATIENT tables or any other linked tables? -- ...

Sharing only forms, not tables
I have an access database. I have designed several forms which shows information retrieved by querries. I would like to share this forms with my colleagues via server. But, i dont want my colleagues to access tables and querries, because of security reasons. Could you pleae tell me a good reference to do that? How can i keep my tables in a seperate place than forms. Thanks That's not going to work. Forms have no data of their own. They read their data from and write their data to tables. If your users have not rights to read or write the tables, your forms won't work either. -- A...

How to customize the Item Properties Form
Is there any way to add additional fields to the Item Properties page in RMS? I have used QSRules to modify the POS Screen in the past but don't see any way to modify any of the forms from within Manager. I would like to either add more fields or pop a custom form after tabbing off the Item Lookup Code field. Thanks! Nope, no way to modify the built in forms. You can replace them, as several existing add-ins do. You can also use the ItemSave hook to pop your form after the OK button on Item Properties is clicked. That's the most granular activation that's available. Gle...

Run query from date input on form
Hello all! I have what I hope is a easy situation. I have a table that has information that is entered daily with a field "Completed Date". I want to add a text box to a form where a user can enter a date and hit a button that will run a query for that specific completion date so I can have the query results exported to Excel. Would I use an unbound text box on the form? How would I set up the query to take the date entered in the form? Thank you very much! - Joker -- Message posted via http://www.accessmonster.com Yes, an unbound textbox would be one w...

Workflow Engine -- Firing on Change to a Field in Existing Record
Hi, Has anyone found an acceptable work-around to fire off an automated workflow rule when a value in a field of an EXISTING record changes? Out-of-the-box you can only trigger rules to run when a record is created, the status changes (active or inactive) or run manually. Alan ...

Event Triggered in Wrong Sheet
Hi, I am using excel 2003 and have a workbook with 2 sheets and the code below in "ThisWorkbook". Private Sub Workbook_BeforePrint(Cancel As Boolean) Worksheets("Sheet1").Activate Worksheets("Sheet1").Select If Range("A1") = "" Then Cancel = True Range("A1").Select MsgBox ("Type in the missing data...") GoTo ExitNow End If ExitNow: End Sub If I leave cell A1 on Sheet1 blank, then click on Sheet2 and try to print, it will place the curs...

RMS should provide a discount associated with payment form
Not all forms of payment are alike. Credit cards have a commision the bank charges for us to accept it, credit has a risk implicit. It would be very valuable for Retailers if a discount on the sale could be associated to one or more forms of payment. I.e. if the customer pays in cash he or she would be eligible for a special discount, because those forms of payment does not cost the retailer any extra risk or commision. This could be an advantage for those customers paying in that particular form and could be used to attract this kind of consumers. In many countries most small retailer...

How to run client-side scripts without picklist OnChange event?
Is there a way to run a client side script from a CRM form other than using the picklist OnChange event? I need to do some simple data validation when a text boxt changes or when a product is selected for a quote. In this version, the picklist is the only supported way of accomplishing this. However, if you are good with XML, you can hack javascript into other fields. - First, make sure you have an OnChange defiend for a picklist field. - Then export the customizations to an XML file. - Now edit the XML file and find where the OnChange event you added is. Add a similar node to anot...

Lookup query value from Form
Hello. I have a form that I would like to lookup values in several taxt boxes. The values I want displayed are from several different Sum Queries. Example: I want to pull Total Working Blance from a query and monthly rent revenue from another query. The values all come from different tables. Is this possible? Thanks for the help. you can use a DLookup() function to retrieve the queries' values. read up on the function in Access Help, so you'll understand how it works. then add an expression to each textbox control's ControlSource property, as =DLookup("MyField", ...

Employee Time card form
I have a table containing two fields - Employee_ID and Time_Stamp. I've already created a form that scans in Employee_IDs; and once any Employee_ID is scanned in, the ID and scanned time is recorded to the table. In addition to what it already does, the form needs to populate the employee's punch time records for the current week. For example: (current date and time is Wednesday 9:02 am) (Form view before update) Employee ID: ___________________ (Form view after update) Employee ID: _1001 (Enter)_______ ________________________________ Employee ID: 1001 Mon: ...

How do I recover deleted calendar event? Outlook 2007
I accidentally deleted a recurring event in outlook when syncing with my phone. Have tried looking online but could not find any relevent help. Mik If its not in the deleted items folder, you'll need to restore a backup copy as its deleted for good. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEAC...

Read only Form when opened
Hi In need to be able to open a form read only until I select a record from a combo box I want to keep from entering the information in the first record that comes up when I open the form Thanks That sounds like it would work I Estimate for a commercial wood working firm I use Access to track my jobs and generate Bids For example I might bid a hotel and need to exclude 300 wood doors and frames. So that would go into me exclusion field I need to make sure that the exclusion is attached to the right job This all works on a form with a sub form, the main form is information about...

3rds landscape form on word mac
I've been PC for so long the MAc is slowly winning me over though! How do I get my document to go in 3rd's for landscape form? G Submitted via EggHeadCafe - Software Developer Portal of Choice How to hold a successful meeting http://www.eggheadcafe.com/tutorials/aspnet/0059747f-8775-4965-b56d-cab220b2f1b9/how-to-hold-a-successful.aspx I think we need a bit more detail. Are you trying to create three columns on a landscape document or three rows? -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org <G Soil>...

Microsoft Exchange Event
Hi, I am trying to start Microsoft Exchange Event service, however I am unable to do so. I get the following error in MMC: "Could not start the Microsoft Exchange Event service on Local Computer. The service did not return an error. This could be an internal Windows error or an internal service error. If the problem persists, contact your system administrator." Also, in the Application log this error is recorded: "An unexpected MAPI error occurred. Error returned was [0x80004005]." I looked at Microsoft Knowledge Base Article 212933, however, after carrying out all the...

help with coding
Hi All, I have been doing some search on this topic and require some coding help. I want to create a login form which checks for username, pwd and securitylevel and accordingly give access to certain queries , forms and reports. I do not want to use the Access user level security wizard and want to create a separate security module. I have come across this code posted by Klatuu which is probably the solution i am looking for. Public Function SetSecurityProp(UserInitials As String, SecurityLevel As Integer) As Boolean Dim prp As Property Const conPropNotFound As Integer = 3270 ...

Data input OK but form not dispalying information back
Hi I have created various forms and tables successfully but suddenly I have one form which is not behaving as i would expect. When I enter data into this form, it appears to have been saved in the table, however, when I exit the form and then go back in to check the data, it is no longer displayed. I am new to access and have been teaching myself as I go along. Obviously I am missing someting here. Can you help me please? Many Thanks-- Tash It is possible you may have changed the data entry properties for the form. I think that would be unlikely for a beginner. Check the properties ...

Event ID: 2115
I have begun noticing the following errors: Type: Warning Source: MSExchangeIS Mailbox Store Event ID: 1173 Event Time: 2/15/2005 7:37:40 AM User: n/a Computer: ECH209 Description: Error 0x6bb deleting unused restricted view from folder 1-9F67D1 on database "First Storage Group\ECH Mailbox Store (ECH209)". Microsoft Exchange Information Store will try to delete the view again at the next maintenance interval. I've checked eventid.net to no avail. Anyone know why this message is showing up? Thanks in advance. ...

Capture outlook explorator event in vb6
Hi, How to get an user event in the outlook explorer back into a vb6 form VB6 gives this code but I can't get it, would you have something else ? Dim myolapp As New Outlook.Application Dim WithEvents myFolders As Outlook.Folders Sub Initialize_handler() Set myNS = myolapp.GetNamespace("MAPI") Set myFolders = myNS.GetDefaultFolder(olFolderDeletedItems).Folders End Sub Private Sub myFolders_FolderChange(ByVal Folder As Outlook.MAPIFolder) Dim name as string name = Folder.name End Sub Thanks Download the ItemsCB COM addin sample from the Resources page at www.microe...