|
-
Jan 31st, 2000, 04:07 AM
#1
Thread Starter
Junior Member
Hi,
I am trying to use parameters with DataReport. A friend gave an example of one that works. It is coded over the Nwind.mdb file. I made a few changes. I changed the SELECT statment to select for City rather the customer ID and I started getting the follow error mag.
failed getting reowset(s) from current datasource.
Here is the code with remarks showing where the problem occurs.
Private Sub Search_Click()
'The If block closes the recordset if it was previously open before
'running the parameterized query.
With DataEnvironment1
If .rsCommand1.State = adStateOpen Then
.rsCommand1.Close
End If
' This passes in the value entered into the TextBox.
.Command1 Text1.Text
' This If block checks to determine if any records are returned
' by the parameter. Then it shows a report if records are returned.
' Or displays a Message Box if no records are returned.
If .rsCommand1.RecordCount > 0 Then
' Degbug shows a number of records in the data source
Set DataReport2.DataSource = DataEnvironment1
' The Error is "Failed getting Rowset(s) from current data source"
DataReport2.Show
Else
MsgBox "No Titles found" & Text1.Text
End If
End With
End Sub
Any help is appreciated.
Thanks,
Jim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|