Wrox Programmer Forums
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics 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 February 19th, 2007, 07:18 PM
Authorized User
 
Join Date: Dec 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cant Add New Data

I have an Access Database that I imported into VB 2005.
I have created forms and linked to the tables.
I have added a binding navigator to the form

I can move around in the records, I can modify and save records, I can delete records. What I CANT DO is add new records. When I hit the add new button in the navigator the forms moves to the next location as indicated by the record counter in the navigator.

I can enter data and everything seems to be working just great.
When I leave the form and come back, the new record that I added is not there. Only the previous count of records shows in the navigator.

I have tried everything I know and cannot seem to figure out just how to make the form save the new record.

Please point me in the right direction!

Thanks,
George Race
 
Old February 20th, 2007, 08:16 AM
Authorized User
 
Join Date: Nov 2006
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ef1196
Default

Without seeing the code I can only guess, but it may be that your Table/Data Adapter is not properly configured for issuing an update back to the underlying database. Is this sample code from a book or your own? In either case, is there a save function after adding a new record? Check your Table/Data Adapter's Update command to start with.



Best Regards,
Earl Francis
 
Old February 20th, 2007, 11:48 AM
Authorized User
 
Join Date: Dec 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Earl:

The tables I am using are of my own design. I have a successful program in Access VBA that I want to convert to VB2005.

I have even gone as far as to write my own new item and save language, to be used by the binding navigator "click" methods. I have imbedded message boxes in the routines so I know they are being run when I click on an icon in the binding navigator.

I think their must be some very simple thing that I am overlooking with the table setup or somewhere in that are.

I have looked at the table adaptor update command, and it appears to be configured correctly.

Seems strange that I can delete a record, modify and save a record, but just cant add a new record.

Any ideas you can suggest would be appreciated. At the moment, this seemingly simple process is holding up the whole process!

Thanks,
George

 
Old February 21st, 2007, 07:12 AM
Authorized User
 
Join Date: Dec 2005
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I finally have it working!

Don't know exactly what was wrong. I redid all my my SQL statements in the query group and now they all work properly.

Wish I had an answer as to what I did, but anyhow they now work.

Thanks for the help. Sure I will be back with more questions.

George






Similar Threads
Thread Thread Starter Forum Replies Last Post
can not add data into database khaink ASP.NET 1.0 and 1.1 Basics 6 January 12th, 2008 11:39 AM
Using data from one cell to add to another LordJaffa Excel VBA 1 September 12th, 2007 03:27 PM
Search / Add data in a ComboBox Sudoku Pro VB Databases 1 May 4th, 2006 07:51 PM
How to add data to a DataGrid Cell. chiefouko VS.NET 2002/2003 2 July 28th, 2004 01:24 AM
Add Data to Listview BradLee31 VB How-To 2 April 13th, 2004 07:55 AM





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