AfterUpdate unreliable?

N

Niniel

Hello,

I use the AfterUpdate event to copy text from an unbound textbox to a bound,
hidden textbox, which, presumably, will lead to an immediate update of the
query and therefore the table.
However, I have noticed that the update is not immediate, nor is it even
guaranteed.
I've been testing this by changing the value in my text box, then tabbing
out, and then going back to another record.
I would have thought that the act of tabbing out of the textbox after the
content was changed would fire the AfterUpdate event, but when I check the
table, there's no change in the text field.

So I'm wondering - is the AfterUpdate event the wrong event to use? If so,
which one would be better? On Dirty? Or does that only work when entering
something into a blank text box?
I find this rather puzzling because I'm using the same method elswhere on my
form, and there it appears to be working.

Any idea?

Thank you.
 
N

Niniel

Update - Only when I edit existing text does this seem to happen. When I
clear the textbox/field first - by copying Null to it - and then write new
text, it is working.
 
N

Niniel

It's no the event, it's my method of moving the data...

Me!sfrmBrowsePromotion![Note] = Me.NoteText6

Isn't working so well, I also saw text put into the wrong record.
I guess I better go back to using an update query.

DoCmd.SetWarnings (False)
DoCmd.RunSQL "Update qryBrowsePromotion Set [Note] =
Forms!frmBrowseApplications.[NoteText6] WHERE [ActivityID] =
Forms!frmBrowseApplications.[ActivityID] And [QuestionID] = 96"
DoCmd.SetWarnings (True)
 
N

Niniel

Very strange though, because using this method to clear the text field does
work:

Me.Note.Value = Null
 
R

red6000

Don't you need to use the REQUERY code to re-update a field which has
already been populated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top