how to update the table, without closing the current form?

Y

Yue Zhao

Hi, I have data setting as below:

T: a talbe
F: a form, whose data source is the table T
ID: a field in table T
ID_Text: a text box in form F, and it's control source is the field ID
in table T

Now, the form F is open.

I realize that, usually, when the ID is changed by editing ID_Text, the
table T won't be updated until form F is closed.
So, my question is, how to change the ID field value in table T, as soon
as the ID_Text is modified, and without having to close form F?

Thanks a lot!
 
D

David Conger [MSFT]

You could add an event to the ID_Text field in teh Form. An After Update
even would fire after the value was changed. Set the event procedure to do
something like:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

(Note that is the same basic code that is created if you create a Save
Record command button.) The record will then save immediatly to the table
after the field is updated.

--
David Conger
Software Development Engineer in Test
Microsoft Office Access

** This posting is provided "AS IS" with no warranties, and confers no
rights. **
 
A

aaron.kempf

use Acces Data Projects so you don't have random locking problems

you can't even run SQL against a record that's being displayed in MDB
without causing all sorts of problems
 
Top