Private Sub RetErive_Click()
Dim e As String
Dim sp As String
e = InputBox("Please Enter the Bill No", "Retrive")
Set ln = New ADODB.Connection
Set ls = New ADODB.Recordset
ln.ConnectionString = "Provider=microsoft.jet.oledb.4.0;" & "Data source =" & App.Path & "\Bills_Service.mdb"
ln.Open
sp = "Select * FROM BILLS WHERE Bill_No = " & e & ""
With ls
[COLOR="Red"].Open sp, ln, adOpenKeyset, adLockPessimistic, adCmdText[/COLOR]
End With
RID.Text = ls.Fields("RID").Value
Dob.Value = ls.Fields("Date of Bill").Value
Vend.Text = ls.Fields("Name of Vendor").Value
BillNo.Text = ls.Fields("Bill_No").Value
BillAmt.Text = ls.Fields("Bill Amount").Value
Stat.Text = ls.Fields("Del To").Value
Statdt.Value = ls.Fields("Del On").Value
Remark.Text = ls.Fields("Remarks").Value
CMC.Text = ls.Fields("CMC Ref No").Value
CheqNo.Text = ls.Fields("Cheque No").Value
Cheqdt.Value = ls.Fields("Cheque Date").Value
ls.Close
ln.Close
End Sub