Posted 30 September 2019, 3:53 pm EST
HI guys I am using visual basic 6.0
and i am having problem … actually the listboxes were working fine and suddently they stopped retriving data from ms access database…and the database is working fine with other activities or controls… i am posting my code bellow…thanks in advance code]Private Sub Command1_Click()
Dim db2 As Database
Dim rs2 As Recordset
Dim Tot As Integer
Dim gst, gtot As Double
Tot = 0
Set db2 = OpenDatabase(“D:\OrderMania\ordermania.mdb”)
Set rs2 = db2.OpenRecordset(“select * from order1”)
While Not rs2.EOF
If StrConv(Text3.Text, vbProperCase) = rs2.Fields(7).Value And Text1.Text = rs2.Fields(0).Value And rs2.Fields(9).Value = “Waiting” And rs2.Fields(8).Value = “Pending” Then
MsgBox “Customer Yet to be Served”, vbCritical, “Order Waiting”
Exit Sub
End If
rs2.MoveNext
Wend
While Not rs2.EOF
If StrConv(Text3.Text, vbProperCase) = rs2.Fields(7).Value And Text1.Text = rs2.Fields(0).Value Then
List1.AddItem (rs2.Fields(2).Value)
List2.AddItem (rs2.Fields(4).Value)
List3.AddItem (rs2.Fields(3).Value)
List4.AddItem (rs2.Fields(5).Value)
Text2.Text = rs2.Fields(1).Value
Text7.Text = rs2.Fields(6).Value
Tot = Tot + rs2.Fields(5).Value
lblstatus.Caption = rs2.Fields(8).Value
End If
If lblstatus.Caption = “Paid” Then
lblstatus.ForeColor = vbGreen
Else
lblstatus.ForeColor = vbRed
End If
rs2.MoveNext
Wend
Text6.Text = Tot
gst = Tot * 0.05
Text5.Text = gst
gtot = Tot + gst
Text4.Text = gtot
End Sub