Print Only The Current Record To A Report

scjohn

Registered User.
Local time
Today, 14:04
Joined
Nov 3, 2004
Messages
31
I'm trying to print out only the current record from my form to a report but each time i recieve an error and dont understant why. this is the code that i have:

Dim strDocName As String
Dim strWhere As String
strDocName = "Resources" 'open report
strWhere = "[ResourceID & ResourceTypeID & ScheduleID & ScheduleDetailsID]= " & Me!ResourceID & _
Me!ResourceTypeID & Me!ScheduleID & Me!ScheduleDetailsID
DoCmd.OpenReport strDocName, acViewPreview, , strWhere

the error that i continue to recieve is ResourceTypeID is not found or does not exist. if i delete it then another error appears saying the ScheduleID is not found or does not exist.
can you help?
 
sc,

Code:
strWhere = "[ResourceID] = Me.ResourceID & " And " & _
           "[ResourceTypeID] =  Me.ResourceTypeID & " And " & _
           "[ScheduleID] =  Me.ScheduleID & " And " & _
           "[ScheduleDetailsID] = " &  Me.ScheduleDetailsID

Wayne
 
Thanks for the help. I'm still getting errors, "End of statement expected" and the ResourceTypeID is still creating errors. The resourcetypeID stores locations, so i know this works. please help.
:confused:
 
sc,

Are all of the values numeric? If not you'll need to delimit them with
quote-marks.

Can you post a sample?

Wayne
 

Users who are viewing this thread

Back
Top Bottom