Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Update fields AfterUpdate not working automatically

Posted on 2012-08-16
8
Medium Priority
?
392 Views
Last Modified: 2012-08-16
I have several fields on my form that AfterUpdate 2 fields automatically get updated:
This one is for [Side]

Private Sub Side_AfterUpdate()
Me.SideUser = fn_get_user_name()
Me.SideStamp = Now
End Sub

On my form that I saved as a backup, these fields are updated automatically as soon as I update [Side].  The 2 controls are immediatly populated.

On a copy I made of a different form and made changes to I have the exact same code and it doesn't update the SideUser and SideStamp fields until I refresh the form or when I click in the User or Stamp fields.  

There is something in this form that is keeping the fields from updating the data as soon as a change is made.  The 2 forms are almost identical.

I put a me.refresh in but this causes a flicker I don't like.  

Private Sub Side_AfterUpdate()
Me.SideUser = fn_get_user_name()
Me.SideStamp = Now
Me.Refresh
End Sub

Any ideas?
0
Comment
Question by:Scotto123
  • 4
  • 3
8 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38302039
<On a copy I made of a different form and made changes to...>

...and these changes were?...
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38302092
What fields do you have on this form other than Side, SideUser and SideStamp fields?

The After Update event will not run until you click out of the Side textbox.
0
 

Author Comment

by:Scotto123
ID: 38302141
Yeah, the changes don't take effect until I click on the boxes that are to be updated.  Even if I change records or fields, the change doesn't happen.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 61

Expert Comment

by:mbizup
ID: 38302179
Are you able to post a sanitized sample of your database demonstrating this?

Not that I'm questioning it, of course ;-)   It just seems unusual enough (I don't think I could recreate that issue) that actually seeing it might help.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 38302206
Just for kicks, before doing that click the "..." next to After Update in the textbox's property sheet, to ensure that the event is 'connected' to the code.
0
 

Author Comment

by:Scotto123
ID: 38302257
Copy Of WhiteBoard_Audit works - auto refreshes

WhiteBoard_Audit doesn't update when changes are made.
RADONC-Error.accdb
0
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 38302324
It looks like your textboxes for SideUser and SideStamp are not properly named -- they have the default names like text1546 and text1641.

Your code is updating the underlying field, but it is not reflected in the textboxes.

Try renaming the textboxes as SideUser and SideStamp.
0
 

Author Comment

by:Scotto123
ID: 38302408
Oh.  That's the answer I was looking for!  I copied the boxes into the form and it didn't keep the names.  

Thanks Biz!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Implementing simple internal controls in the Microsoft Access application.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question