p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Visual Basic 2010 Programmer's Reference (http://p2p.wrox.com/book-visual-basic-2010-programmers-reference-551/)
-   -   VB 2010 data from txtbox to Access 2007 table (http://p2p.wrox.com/book-visual-basic-2010-programmers-reference/85855-vbulletin-2010-data-txtbox-access-2007-table.html)

ByteWorker November 30th, 2011 01:46 AM

VB 2010 data from txtbox to Access 2007 table
I am using VB 2010 for a menu and code & MS Access 2007 for tables. I am using data binding to lock a text box to an Access table. I want to input text into the text box and press the TAB key or the ENTER key to go to the next text box. At the same time I want the text in the first text box to be transfered and appended to the Access 2007 table. Thank you for any thoughts you can share on this.

Rod Stephens November 30th, 2011 11:33 AM

Normally when you use data binding the control is bound to some object that has a notion of the current record. You need to figure out which record that is and make it move to a new record. That should update the value in the current record to whatever is in the TextBox.

If you want to create a new record, you need to call that object's AddNew method (or whatever method it provides for creating a new record). You then need to call it's Update method when you're done to accept the new record.

Overall I think data binding might be a little confusing for this. I would probably just use a SQL INSERT statement (or some other direct database method) instead of data binding to add the record when focus moves to the next field.

All times are GMT -4. The time now is 09:34 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.