473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

problems with Add record functionality

Hey all -

I have a windows form (using VB) in which I display basic information
about a person, all of which is housed (for now) in a single Access
table, which I'll call "tblPerson". I would like to select a set of
records and display one at a time in text boxes with the following
buttons:

Next - Moves to next record
Previous - Moves to previous record
Add - Adds a blank new record
Delete - Deletes the current record
Save - Saves any changes back to the DB.

Pretty standard stuff. I am using a CurrencyManager to manage record
position in the dataset. The data shows correctly and the record
navigation works fine. The issue that I am dealing with right now, is
as follows:

When make a call to cmPeople.AddNew() NOTHING happens! I do not get a
blank record to display as desired. That said, cmPeople.Count is
incremented by 1 when I click my Add button. Any ideas? Below is
some relevant code:
Private Sub GetPersonMain()
...

daPersonMain = New OleDbDataAdapter(strPersonMainSQL, cnConnection)
ds = New DataSet
daPersonMain.Fill(ds, "PersonBasic")
...
Me.txtFirstName.DataBindings.Add("text", ds,
"PersonBasic.name_first")
Me.txtLastName.DataBindings.Add("text", ds,
"PersonBasic.name_last")

cmPeople = CType(BindingContext(ds, "PersonBasic"),
CurrencyManager)
End Sub
***

Private Sub mnuAddNewPerson_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles mnuAddNewPerson.Click

cmPeople.AddNew()

End Sub

Any ideas???

Thx.Brian
Nov 20 '05 #1
1 1161
Hi Brian -

It is most likely due to the way the controls handle Null values. Check out
this article and see if this helps your particular situation. (your app may
not use a checkbox but try setting a default value for your columns to see
if the record is added.

You can check out this article
BUG: AddNew Method of CurrencyManager Fails with Bound CheckBox
http://support.microsoft.com/default...b;en-us;326440
hope this helps

Steve Stein,
Visual Basic Team

--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).


--------------------
| From: br*********@yahoo.com (Brian)
| Newsgroups:
microsoft.public.dotnet.framework.adonet,microsoft .public.dotnet.languages.v
b
| Subject: problems with Add record functionality
| Date: 15 Oct 2003 18:14:06 -0700
| Organization: http://groups.google.com
| Lines: 52
| Message-ID: <be*************************@posting.google.com>
| NNTP-Posting-Host: 64.170.104.17
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1066266847 10740 127.0.0.1 (16 Oct 2003
01:14:07 GMT)
| X-Complaints-To: gr**********@google.com
| NNTP-Posting-Date: Thu, 16 Oct 2003 01:14:07 +0000 (UTC)
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!news.maxwell.syr.edu!postnews1.google.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:147146
microsoft.public.dotnet.framework.adonet:63730
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Hey all -
|
| I have a windows form (using VB) in which I display basic information
| about a person, all of which is housed (for now) in a single Access
| table, which I'll call "tblPerson". I would like to select a set of
| records and display one at a time in text boxes with the following
| buttons:
|
| Next - Moves to next record
| Previous - Moves to previous record
| Add - Adds a blank new record
| Delete - Deletes the current record
| Save - Saves any changes back to the DB.
|
| Pretty standard stuff. I am using a CurrencyManager to manage record
| position in the dataset. The data shows correctly and the record
| navigation works fine. The issue that I am dealing with right now, is
| as follows:
|
| When make a call to cmPeople.AddNew() NOTHING happens! I do not get a
| blank record to display as desired. That said, cmPeople.Count is
| incremented by 1 when I click my Add button. Any ideas? Below is
| some relevant code:
|
|
| Private Sub GetPersonMain()
| ...
|
| daPersonMain = New OleDbDataAdapter(strPersonMainSQL, cnConnection)
| ds = New DataSet
| daPersonMain.Fill(ds, "PersonBasic")
| ...
| Me.txtFirstName.DataBindings.Add("text", ds,
| "PersonBasic.name_first")
| Me.txtLastName.DataBindings.Add("text", ds,
| "PersonBasic.name_last")
|
| cmPeople = CType(BindingContext(ds, "PersonBasic"),
| CurrencyManager)
| End Sub
| ***
|
| Private Sub mnuAddNewPerson_Click(ByVal sender As System.Object, ByVal
| e As System.EventArgs) Handles mnuAddNewPerson.Click
|
| cmPeople.AddNew()
|
| End Sub
|
| Any ideas???
|
| Thx.Brian
|

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: peter | last post by:
Hello all, Recently I've started to refactor my code ...(I'm using python 2.3.4) I tried to add extra functionality to old functions non-intrusively. When I used a construct, which involves...
8
by: Steve Jorgensen | last post by:
Hi folks, I'm posting this message because it's an issue I come up against relatively often, but I can't find any writings on the subject, and I haven't been able to figure out even what key...
3
by: HateSpam | last post by:
I have a read-only form that allows the user to browse clients. There are buttons on the form that allow the user to 'Add New' or 'Edit Existing'. They both lead to the same form: frmClient ...
4
by: steph | last post by:
Hi, A question regarding Access 2002: I've got a form which should be displayed in Form View and in Datasheet View. But I want to use a different record source for each view. That means, when...
3
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
19
by: MaXX | last post by:
Hi, I hope I'm not OT. I have the following issue: I want to delete a record from my db with a php script. Let's say I'm auth'd and I want to delete the record id 440. With a simple form (get...
4
by: bobg.rjservices | last post by:
running access 2k; adp w/ linked tables to SQL server; I am absolutely stymied, and ticked off beyond belief - I can not believe how much time I've wasted trying to do something that should be...
51
AccessIdiot
by: AccessIdiot | last post by:
I have a form (frm_Specimen_Entrainment) that contains a subform (sbfrm_FishSpecimen_Entrainment). The subform has to be in datasheet view. On the form I have an unbound textbox where the user can...
1
by: noname101 | last post by:
I'm very new to VBA and am trying to teach myself a lot of this so please bare with me. I have just one table and what I'd like to do is have a text box and button captioned "Find". Of course...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.