-
Updating form from Access
I am having probs filling my text boxes with filtered data. I first fill a combo box to get a customer name which fills another combo box with order numbers related to that customer. My problem is filling the text boxes with order details once an order number is selected. What am I doing wrong here? I am getting an IndexOutOfRange error at the bolded item.
Private Sub Form1_Load
'fill data set
daCompany.Fill(dsCompanyObj)
'Company combo box selects nothing at start up
cbCompany.SelectedIndex = -1
End Sub
Private Sub cbCompany_SelectedIndexChanged
'if selection has made
If cbCompany.SelectedIndex <> -1 Then
'enable the order number combo box
cbOrderNum.Enabled = True
'clear order number dataset
dsOrderNumObj.Clear()
'fill order number data set and combo box
daOrderNum.SelectCommand.Parameters("CustomerID").Value = cbCompany.SelectedValue
daOrderNum.Fill(dsOrderNumObj)
' Order number combo box does not select anything yet until changed
cbOrderNum.SelectedIndex = -1
End If
End Sub
Private Sub cbOrderNum_SelectedIndexChanged
'if selection has been made
If cbOrderNum.SelectedIndex <> -1 Then
'enable buttons
btnPrevOrder.Enabled = True
btnNextOrder.Enabled = True
btnPrevProd.Enabled = True
btnNextProd.Enabled = True
'fill the dataset
daOrderDetails.SelectCommand.Parameters("OrderID").Value = cbOrderNum.SelectedValue 'daProducts.Fill(dsProductOrderDetails)
'daOrderDetails.Fill(dsProductOrderDetails)
daOrders.Fill(dsProductOrderDetails)
-
I resolved the problem (with the help of a friend). I was calling something that wasn't in the query.
Similar Threads
-
By brianb13 in forum .NET
Replies: 1
Last Post: 03-16-2005, 08:21 AM
-
By C. Gonzales in forum VB Classic
Replies: 1
Last Post: 01-01-2002, 06:53 AM
-
By Rickmister in forum VB Classic
Replies: 0
Last Post: 12-16-2001, 09:11 PM
-
By ZARVAL in forum VB Classic
Replies: 0
Last Post: 04-18-2000, 10:08 PM
-
By Dennis in forum VB Classic
Replies: 0
Last Post: 03-16-2000, 02:13 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks