(And btw, inc is set as an integer earlier on in the program)
Expand|Select|Wrap|Line Numbers
- Dim CustomerID As Integer
- 'asks for the customer's ID number so that their results can be found.
- CustomerID = Val(InputBox("what is the Customer number?"))
- Try
- Sql = "Select * from tblQuotes WHERE CustomerID = " & CustomerID
- 'dataAdapter obtains data from database
- da = New OleDbDataAdapter(Sql, con)
- da.Fill(ds, "CustomerID")
- 'count number of rows(records) in the dataset
- 'finds the row which the customer id is in
- inc =WHATEVER THE ROW NUMBER IS
- If ds.Tables("CustomerID").Rows.Count > 0 Then
- TxtName.Text = ds.Tables("TblQuotes").Rows(inc).Item("CustomerName")
- TxtHouse.Text = ds.Tables("TblQuotes").Rows(inc).Item("HouseNumberName")
- TxtTown.Text = ds.Tables("TblQuotes").Rows(inc).Item("TownCity")
hopefully with the text WHATEVER THE ROW NUMBER IS being replaced by actual code to get it to that row.
Also, if this is not possible, can anyone suggest a better way of doing it?
Thanks in advance for any help