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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report designer control, setting sql string for report

Status
Not open for further replies.

bdotzour

Programmer
Jun 7, 2001
17
US
After searching and reading and failing, I hope I can find help from the gurus.

Here's what I'm doing in a nutshell:

1. The basic form (copied from dev. guide) with two tabs (one for report design, one for preview).

2. I want to filter out the records that will show up in the report that the user designs. They can choose whatever columns to display in the report, but I need to restrict which rows show up.

3. The app runs just fine, no problems, however when I preview the report I get all rows. If I go back and look at the design tab and choose "View SQL Query", it shows me the default query.

A shortened version of my code is listed below. Any help would be greatly appreciated. Thanks :)

' *** BEGIN CODE ***
Option Explicit

Dim m_Application As New CRAXDDRT.Application
Dim m_Report As CRAXDDRT.Report

Set m_Report = Nothing
Set m_Report = m_Application.NewReport

m_Report.Database.Tables.Add tablename, , , 1, "p2sodbc.dll", DSN, , db, user, pass
m_Report.SQLQueryString = myquery 'assume string literal
If SSTab1.Enabled = False Then SSTab1.Enabled = True
CRDesignerCtrl1.ReportObject = m_Report
CRDesignerCtrl1.EnableHelp = False
CRViewer1.ReportSource = m_Report
CRViewer1.ViewReport
CRViewer1.Zoom 1

 
Well, from debugging, it appears that the SQLQueryString value stays blank ("") even immediately after my assignment statement. I guess that would explain why the report doesn't have my query. =)

Why would this call not work?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top