SQL Statement Syntax

dudezzz

Registered User.
Local time
Today, 05:17
Joined
Feb 17, 2005
Messages
66
Hi,

I am trying to run a pass through query from a simple report that I have.

The Syntax for the Pass through Query is as follows:

SELECT "Assigned-To-Individual+", "Case-ID+" FROM HPD_HelpDesk WHERE "Assigned-To-Group+" = 'TEST' AND "Status" IN ( 'ACCEPTED','ASSIGNED' )


I am able to execute this pass through query without any problem when i run it.

Now, I want to include this query as the Record Source of a Report. I want to do this from within VBA (due to specific reasons)

On the Report's On Open Event I have the following:

Private Sub Report_Open(Cancel As Integer)
Dim ssql As String
Me.RecordSource = <SQL Statement here>
End Sub

What is the correct Syntax for the above SQL Statement that I should include for this Report to work? I tried playing around with this but I was unable to get it to work so far. Any help would be appreciated.
 
dude,

I'd bind the report to a query. On the CommandButton that runs the report,
generate the SQL String and assign it using a QueryDef. Use the Search
Facility here and look for "QueryDef", you'll find many examples.

Wayne
 

Users who are viewing this thread

Back
Top Bottom