Reports Property: Im Desperate For Help

  • Thread starter Thread starter CornDog
  • Start date Start date
C

CornDog

It errors on rpt = Me!Comb0
My guess is it is becuase Me!Combo0 isnt of Report obj
type so... Im too tired at the moment to think on.

Dim rpt As Report
rpt = Me!Combo0
Reports!rpt.Filter = strSQL
-----Original Message-----
Try this:

Dim rpt As Report
rpt = Me!Combo0
Reports!rpt.Filter = strSQL

***Note: that the value in the bound column of your
combobox/listbox must be a string, and more specifically,
the exact name of the report.

-----Original Message-----
Reports![rptOutstandingTransfers].Filter = strSQL

I need to be able to replace [rptOutstandingTransfers] with
something dynamic.

Preferably with a value from a control on a form.
I tried but failed :(

ALSO

I thought maybe I could construct a string like this

strTemp = "Reports![" & Me!Combo0.Value & "].ControlSource"

And the say something like strVariable = DoCmd.???? strTemp
strVariable woudl then = the controlsource of the report.

Any ideas is this possible what should I be doing?

Thanks for any help.
.
.
 
Still STUCK!!!

Reports![rptOutstandingTransfers].Filter = strSQL
Reports![rptOutstandingTransfers].FilterOn = True

This is what I have been trying with Eval() to no success

Eval("Reports![" & Me!Combo0 & "].Filter = strSQL")
AND
Eval("Reports![" & Me!Combo0 & "].Filter") = strSQL

Is there code to say something like For the current report
I thought acReport.Filter = strSQL might work. But its
ambiguous. Any ideas?


-----Original Message-----
It errors on rpt = Me!Comb0
My guess is it is becuase Me!Combo0 isnt of Report obj
type so... Im too tired at the moment to think on.

Dim rpt As Report
rpt = Me!Combo0
Reports!rpt.Filter = strSQL
-----Original Message-----
Try this:

Dim rpt As Report
rpt = Me!Combo0
Reports!rpt.Filter = strSQL

***Note: that the value in the bound column of your
combobox/listbox must be a string, and more specifically,
the exact name of the report.

-----Original Message-----
Reports![rptOutstandingTransfers].Filter = strSQL

I need to be able to replace [rptOutstandingTransfers] with
something dynamic.

Preferably with a value from a control on a form.
I tried but failed :(

ALSO

I thought maybe I could construct a string like this

strTemp = "Reports![" & Me!Combo0.Value & "].ControlSource"

And the say something like strVariable = DoCmd.???? strTemp
strVariable woudl then = the controlsource of the report.

Any ideas is this possible what should I be doing?

Thanks for any help.
.
.
.
 
Wooo Whooo

I created a global report variable and set the report to
that variable when it opened. So now
rptCurrentReport.Filter = strSQL adn the other works.

Thanks for all your help. Now to make this darn thing
reusable without errors. eek!
-----Original Message-----
Still STUCK!!!

Reports![rptOutstandingTransfers].Filter = strSQL
Reports![rptOutstandingTransfers].FilterOn = True

This is what I have been trying with Eval() to no success

Eval("Reports![" & Me!Combo0 & "].Filter = strSQL")
AND
Eval("Reports![" & Me!Combo0 & "].Filter") = strSQL

Is there code to say something like For the current report
I thought acReport.Filter = strSQL might work. But its
ambiguous. Any ideas?


-----Original Message-----
It errors on rpt = Me!Comb0
My guess is it is becuase Me!Combo0 isnt of Report obj
type so... Im too tired at the moment to think on.

Dim rpt As Report
rpt = Me!Combo0
Reports!rpt.Filter = strSQL
-----Original Message-----
Try this:

Dim rpt As Report
rpt = Me!Combo0
Reports!rpt.Filter = strSQL

***Note: that the value in the bound column of your
combobox/listbox must be a string, and more specifically,
the exact name of the report.


-----Original Message-----
Reports![rptOutstandingTransfers].Filter = strSQL

I need to be able to replace [rptOutstandingTransfers]
with
something dynamic.

Preferably with a value from a control on a form.
I tried but failed :(

ALSO

I thought maybe I could construct a string like this

strTemp = "Reports![" & Me!Combo0.Value
& "].ControlSource"

And the say something like strVariable = DoCmd.????
strTemp
strVariable woudl then = the controlsource of the report.

Any ideas is this possible what should I be doing?

Thanks for any help.
.

.
.
.
 
Back
Top