Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Time Error 3709

Status
Not open for further replies.

Rasheed Shaik

Programmer
Mar 20, 2011
23
SA
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
 
Then check to see if it is open before you try & reopen it (even better close it each time you are done with it).

If Not ps Is Nothing Then...

Gluais faicilleach le cupan làn
 
Private rs As New ADODB.connection
Private rr As New ADODB.recordset
Private Sub cmdAcchu_Click()
Set rs = CreateObject("Adodb.connection")
rs.Provider = "Microsoft.jet.oledb.4.0"
'cs.Open App.Path & "\Medrar.mdb"
rs.Open "\\mika\medrar\Medrar.mdb"
Set rr = New ADODB.recordset

rr.Open "select * from Reser where Reno = '" & Combo1.Text & "'", rs, 1, 3

If rr.RecordCount = 0 Then
MsgBox "No record found on query.", vbCritical, "Medrar"

Else
Set Reservation.DataSource = rr
Unload Me
Reservation.Show
End If

Set rr = Nothing

End Sub
********************
Just shows blank report with out records, Why so?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top