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

  • Thread starter Thread starter Yue Zhao
  • Start date Start date
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!
 
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. **
 
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
 

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

Similar Threads

Multi Value Selection issues 4
Update Combo Box 3
Update field with another one 1
Same record/Primary key in multiple tables 0
Form Help 3
Database Design 2
Save query results to another table 6
Access Click in Table to Open Form 0

Back
Top