Hi Cor,
Sorry im been real stupid here. OK i have my App with your code in now and
it works great when I lick on a row it chnged and tells me it Record "?" of
Record "?"
My Code is as follows:-
'Set Databining
txtFirstname.DataBindings.Add("Text", dsSystemUsers, "Passwords.User_First")
txtSurname.DataBindings.Add("Text", dsSystemUsers, "Passwords.User_Last")
txtUsername.DataBindings.Add("Text", dsSystemUsers, "Passwords.Users_Name")
txtPassword.DataBindings.Add("Text", dsSystemUsers,
"Passwords.Users_Password")
'Initialize CurrencyManager for the table "Passwords"
cmSystemUsers = Me.BindingContext(dsSystemUsers, "Passwords")
cmSystemUsers = DirectCast(BindingContext(dsSystemUsers.Passwords),
CurrencyManager)
AddHandler cmSystemUsers.CurrentChanged, AddressOf CurrentChanged
and also
Private Sub dsSystemUsers_PositionChanged()
Me.lblNavLocation.Text = (((cmSystemUsers.Position + 1).ToString + " of ") +
cmSystemUsers.Count.ToString)
End Sub
Private Sub CurrentChanged(ByVal sender As Object, ByVal e As EventArgs)
Me.lblNavLocation.Text = (((cmSystemUsers.Position + 1).ToString + " of ") +
cmSystemUsers.Count.ToString)
End Sub
Now when I Insert a row and add the Data it just inserts Null into all my
feilds
When I check my database it hasn`t updated it with my inputs just
empty fields.
My Insert Code is:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
Try
'Clear out the current edits
cmSystemUsers.EndCurrentEdit()
cmSystemUsers.AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
Me.dsSystemUsers_PositionChanged()
txtFirstname.Enabled = True
txtSurname.Enabled = True
txtUsername.Enabled = True
txtPassword.Enabled = True
End Sub
Then I click a button to call Me.UpdateDataSet. Also if I say Edit Row 33
and change the First_Name from Mark to Say Bob it makes the changes in Row
1, no mater what Row I change it always updates Row 1. I was thinking maybe
I need to call the CurrentChanged in my Update code to get the correct Row
but not sure if i do or even how. Also now I have CurrenctChanged do i Still
need dsSystemUsers_PositionChanged() as I have got rid of my Navigation
buttons on my Form. I'm Also not sure totally about my CurrentChanged as it
hasn`t got the DirectCast bit in but i don`t know how to get that workin
with my code. Also how would I call CurrentChanged from my Code as
Me.CurrentChanged errors.
Any Ideas?
And Again Thnks for your Help So far.
NSC