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!

How can I pass a parameter to a Data Report?

Status
Not open for further replies.

lmarles

Technical User
Dec 8, 2000
25
0
0
CA
I have a Data Environment deBlue
I have a Connection cnnSamples
I have a Command comDailyShift
I have a Data Report drDailyShift
I have an SQL statement in comDailyShift that pulls data from 'Samples' table
in an Access 97 database (Blue.mdb).
I want the report to show only certain records based on a value in the field 'Shift' in the 'Samples' table.
I have a Parameter "Shift" in comDailyShift.
The SQL statement in comDailyShift 'Select Shift, SampleDate, Technician FROM Samples WHERE Shift=?' doesn't work.
In my code I have a variable 'strShift' dimensioned as String.
I set 'strShift' with
strShift = "8-4"
I then attempt to pass the value of 'Shift' to comDailyShift with the folowing code:
With deBlue.Commands("comDailyShift_Grouping")
.Parameters("Shift").Value = strShift
.Execute
End With
drDailyShift.Show
I get the error message
"Method 'Item' of object 'Commands' failed"
All help appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top