By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,145 Members | 1,528 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,145 IT Pros & Developers. It's quick & easy.

A97 delay between subform field update and actual table update...

P: n/a
MLH
If the RecordSource for subform SF on main form MF
is a query and I change one of the field values in the
subform control from 75 to say - 13 and click on another
record, the value in the underlying table is changed. It
can be verified by opening the underlying table directly
from the database window and looking at the record.

But if I set the AfterUpdate property of the control on
SF to a VBA procedure that pops a msgbox up which
displays the control value on the subform #AND# the
table field value read using DLookUp - the table value
shown is still the old value. True enough, the value of
Forms!SF!MyTextBox is 13. But the one read from the
table is still 75. I've found this to be the case regardless
of whether the MsgBox command is preceeded by a
DoEvents command.

My Question: Is there ANY VBA method or procedure
I can implement that would ensure me that both values,
when read, would reflect the NEW value of 13. I mean -
short of ending the procedure, having coffee & donuts
and coming back afterward?
Dec 17 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Mon, 17 Dec 2007 11:10:12 -0500, MLH <CR**@NorthState.netwrote:

You're assuming that Control_AfterUpdate will write that value to the
db. That's not so. Rather after Form_AfterUpdate you may expect the
value to be in the table.
If you want the -not yet saved- value, you can inspect the Text
property of that control when it has focus.

-Tom.

>If the RecordSource for subform SF on main form MF
is a query and I change one of the field values in the
subform control from 75 to say - 13 and click on another
record, the value in the underlying table is changed. It
can be verified by opening the underlying table directly
from the database window and looking at the record.

But if I set the AfterUpdate property of the control on
SF to a VBA procedure that pops a msgbox up which
displays the control value on the subform #AND# the
table field value read using DLookUp - the table value
shown is still the old value. True enough, the value of
Forms!SF!MyTextBox is 13. But the one read from the
table is still 75. I've found this to be the case regardless
of whether the MsgBox command is preceeded by a
DoEvents command.

My Question: Is there ANY VBA method or procedure
I can implement that would ensure me that both values,
when read, would reflect the NEW value of 13. I mean -
short of ending the procedure, having coffee & donuts
and coming back afterward?
Dec 17 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.