AfterUpdate issue

Uni03

Registered User.
Local time
Yesterday, 23:36
Joined
Jul 20, 2011
Messages
51
Hi - In my form I am trying to change a bound field with the value of an unbound field that occurs before it on the form so this new value shows up in the table for that field. The unbound field contains a number from a field on the previous record from the table, and the next field, the bound field, is to get that value. I used the AfterUpdate event in the unbound field property, where unbound field = the bound field. I tried this with the control property, then tried using the AfterUpdate event for the form, and no value appears in the bound field and doesn't show up in the table. Both these fields are in a subform. I used the "Me." prefix for both fields and that doesn't work. Probably some minor thing I am not seeing. Thanks.
 
Here is the db. The subform, frmMachineMeters, has these 23 fields. The unbound field, getBeginRollover, is the previous value that I want to go into the bound field, beginRollover, so that the table will have this value. In the AfterUpdate of the unbound field, I used Me.beginRollover=Me.getBeginRollover because both are in the subform. I am getting no error, just a blank field and the table is not updated with the value. Thanks.
 

Attachments

Are you using Access 2010? I can't open your db because I'm using 2007.
 
Perhaps someone with Access 2010 will be able to help you. Or you can convert a copy of your db to 2007.

In the meantime - and as previously asked - what is the full code?
 
I haven't written any code but the Me.bound control=Me.unbound control in the AfterUpdate of the unbound control. Unless you are referring to the vba code behind the scenes which I don't know how to get at.
 
That's the code I would like to see, what's in the After Update event.
 
Have you checked to see if the event is actually firing? Put a msgbox in there to test.
And you said both controls are on the same form?
 
Both controls are on the same form.
The message box didn't appear.
 
Both controls are on the same form. The unbound control is before the bound control.
I added a msgbox but it didn't appear.
 
In the property sheet, on the Events tab, is the text [Event Procedure] written in the After Update event?
 
You do realise that for the After Update event to fire you must move out of the textbox? Just writing text in there won't fire the event.
 
Yes. I tried both the After Update for the form and for just the control (the unbound control) and the bound field doesn't get updated on the form, and when I close out the form and check the table, the value does not appear in the table.
 
I did some more digging and came across a thread that you were one of the responders in -(ions) who was creating an "infinite loop". The point made there was that the AfterUpdate event won't fire unless you actually enter something into the control. I was using a DLookup to get the unbound control value, so I needed to do something to fire the event. I figured that out and got it to work. Issue resolved. Thanks for your help!
 
Ah, you didn't mention that - about using a function.

Glad to know this is resolved :)
 

Users who are viewing this thread

Back
Top Bottom