Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error - can't create a child list for field ???

Status
Not open for further replies.
Jun 4, 2003
18
GB
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
 


May want to post in the VB.NET forum: forum796

Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top