B
Brian
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
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