CharlotteR
MIS
ive created a basic form, which loads data from a Customers Table from an Access Database. this works great. when i add buttons such as First, Last, Prev & Next, it all goes a bit mad, with the following message appearing:
An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll
Additional information: Can't create a child list for field Customers.
my code for these buttons are as follows (i amended them from the Microsoft Visual Basic.Net book):
Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click
Me.BindingContext(DsCustomers1, "Customers"
.Position = 0
End Sub
Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click
Me.BindingContext(DsCustomers1, "Customers"
.Position = Me.BindingContext(DsCustomers1, "Customers"
.Count - 1
End Sub
Private Sub btnPrev_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrev.Click
Me.BindingContext(DsCustomers1, "Customers"
.Position -= 1
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Me.BindingContext(DsCustomers1, "Customers"
.Position += 1
End Sub
Thanks for any help,
CharlotteR
An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll
Additional information: Can't create a child list for field Customers.
my code for these buttons are as follows (i amended them from the Microsoft Visual Basic.Net book):
Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click
Me.BindingContext(DsCustomers1, "Customers"
End Sub
Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click
Me.BindingContext(DsCustomers1, "Customers"
End Sub
Private Sub btnPrev_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrev.Click
Me.BindingContext(DsCustomers1, "Customers"
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Me.BindingContext(DsCustomers1, "Customers"
End Sub
Thanks for any help,
CharlotteR