Rasheed Shaik
Programmer
Private Sub cmdAcchu_Click()
Set ps = CreateObject("Adodb.connection")
ps.Provider = "Microsoft.jet.oledb.4.0"
'cs.Open App.Path & "\Medrar.mdb"
ps.Open "\\mika\medrar\Medrar.mdb"
Set ls = New ADODB.recordset
ls.Open "select * from reser where reno = " & Combo1.Text & ""
If ls.RecordCount = 0 Then
MsgBox "No record found on query.", vbCritical, "Medrar"
Combo1.SetFocus
Else
Set Reservation.DataSource = ls
Unload Me
Reservation.Show
End If
Set ls = Nothing
End Sub
***
While run the report for above code, it throws error, conncetion is open
Set ps = CreateObject("Adodb.connection")
ps.Provider = "Microsoft.jet.oledb.4.0"
'cs.Open App.Path & "\Medrar.mdb"
ps.Open "\\mika\medrar\Medrar.mdb"
Set ls = New ADODB.recordset
ls.Open "select * from reser where reno = " & Combo1.Text & ""
If ls.RecordCount = 0 Then
MsgBox "No record found on query.", vbCritical, "Medrar"
Combo1.SetFocus
Else
Set Reservation.DataSource = ls
Unload Me
Reservation.Show
End If
Set ls = Nothing
End Sub
***
While run the report for above code, it throws error, conncetion is open