OK i have two listboxes that are populated by data from a Access Db, its populated by a if statement sayin if the data is the same as todays date put it in list box1 and if its tomorrows date but it in listbox 2.
Private Sub orderstatus()
'-------
imputdate = Text30.Text
customDate = DateValue(imput date)
'--------
Dim sql As String
sql = "Select * from Orders"
With Data1
.RecordSource = sql
.Refresh
.Recordset.Move First
Do Until .Recordset.EOF
On Error Resume Next
If .Recordset.Fiel ds(7) = customDate Then
List4(1).AddIte m .Recordset("Ord er_ID")
ElseIf .Recordset.Fiel ds(7) = customDate + 1 Then
List4(0).AddIte m .Recordset("Ord er_ID")
End If
.Recordset.Move Next
Loop
End With
End Sub
The listboxes display an order_ID
that works fine, the problem im having is that i want to click on a order_Id in either of the list boxes and the data for that order id to populate a numer of text boxes,
this is kinda what i got so far
Private Sub Command25_Click ()
rs.MoveFirst
Do Until rs.EOF
If rs.Fields(1) = List4(1). Then
Text29.Text = rs.Fields(0)
Text1.Text = rs.Fields(1)
Text2.Text = rs.Fields(2)
Text3.Text = rs.Fields(3)
Text4.Text = rs.Fields(4)
Text5.Text = rs.Fields(5)
Text6.Text = rs.Fields(6)
Text7.Text = rs.Fields(9)
Else: rs.MoveNext
End If
Loop
Im sure there should be something after the list4(1). but ive been looking though the net and i cant find anything :((
I hope this make sence :D
and i hope you can help !
Thanks a lot
Stu
P.s im using Vb6
Private Sub orderstatus()
'-------
imputdate = Text30.Text
customDate = DateValue(imput date)
'--------
Dim sql As String
sql = "Select * from Orders"
With Data1
.RecordSource = sql
.Refresh
.Recordset.Move First
Do Until .Recordset.EOF
On Error Resume Next
If .Recordset.Fiel ds(7) = customDate Then
List4(1).AddIte m .Recordset("Ord er_ID")
ElseIf .Recordset.Fiel ds(7) = customDate + 1 Then
List4(0).AddIte m .Recordset("Ord er_ID")
End If
.Recordset.Move Next
Loop
End With
End Sub
The listboxes display an order_ID
that works fine, the problem im having is that i want to click on a order_Id in either of the list boxes and the data for that order id to populate a numer of text boxes,
this is kinda what i got so far
Private Sub Command25_Click ()
rs.MoveFirst
Do Until rs.EOF
If rs.Fields(1) = List4(1). Then
Text29.Text = rs.Fields(0)
Text1.Text = rs.Fields(1)
Text2.Text = rs.Fields(2)
Text3.Text = rs.Fields(3)
Text4.Text = rs.Fields(4)
Text5.Text = rs.Fields(5)
Text6.Text = rs.Fields(6)
Text7.Text = rs.Fields(9)
Else: rs.MoveNext
End If
Loop
Im sure there should be something after the list4(1). but ive been looking though the net and i cant find anything :((
I hope this make sence :D
and i hope you can help !
Thanks a lot
Stu
P.s im using Vb6
Comment