Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2010 > BOOK: Visual Basic 2010 Programmer's Reference
|
BOOK: Visual Basic 2010 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2010 Programmer's Reference by Rod Stephens; ISBN: 9780470499832
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2010 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2011, 01:46 AM
Registered User
 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question 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.
 
Old November 30th, 2011, 11:33 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

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.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2007 mail merger Data Source not found on Windows 7 machine. gemost Access VBA 3 June 20th, 2011 01:45 PM
InfoPath 2007 - Retrieve data from one table, submit to another table (same database) lespaul00 Infopath 0 March 25th, 2011 10:21 AM
Using Access 2010 and Access Services with SP 2010 kmaford BOOK: Professional SharePoint 2010 Development 0 September 14th, 2010 04:25 PM
How to specify relative path to Access 2007 in ADO connection string? [Excel 2007] sektor Excel VBA 4 September 3rd, 2009 11:59 PM
How to use access 2007 databases in vb 2005? Richard C. McAdams BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 2 June 16th, 2008 11:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.