If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
ACC2000: save WHERE clause to report via code
I have a report where I need to save the WHERE clause to it, so another
routine (which I did not write) can open the report and create a PDF from it. How do I do this via code? Thank you. |
#2
|
|||
|
|||
ACC2000: save WHERE clause to report via code
|
#3
|
|||
|
|||
ACC2000: save WHERE clause to report via code
You could create a table with fields to store your criteria values. Add this
single record table to your report's record source query and use the criteria fields as criteria. -- Duane Hookom Microsoft Access MVP If I have helped you, please help me by donating to UCP http://www.access.hookom.net/UCP/Default.htm "A Man" wrote: In article , says... I have a report where I need to save the WHERE clause to it, so another routine (which I did not write) can open the report and create a PDF from it. How do I do this via code? Thank you. p.s. My report is not opened via the docmd.openreport command, hence the need to save the WHERE information directly in the report itself. |
#4
|
|||
|
|||
ACC2000: save WHERE clause to report via code
|
#5
|
|||
|
|||
ACC2000: save WHERE clause to report via code
If you really want to change the recordsource of a report, search google on
Access Reports "me.recordsource" You will get tons of hits. -- Duane Hookom Microsoft Access MVP If I have helped you, please help me by donating to UCP http://www.access.hookom.net/UCP/Default.htm "A Man" wrote: In article , says... You could create a table with fields to store your criteria values. Add this single record table to your report's record source query and use the criteria fields as criteria. Ok. I think I will change the report's recordsource property using a different SQL statement for each customer, then call Leban's ConverToPDF function. How do I change the report's .Recordsource property in code? |
#6
|
|||
|
|||
ACC2000: save WHERE clause to report via code
I tried the following but got an error:
sWhere = "[cus_no] = '" & sCustnum & "'" Reports!DealerOrder2.Filter = sWhere Reports!DealerOrder2.FilterOn = True The error was '2451: The report name "DealerOrder2" you entered is misspelled or refers to a report that isn't open or doesn't exist.' So, I can open the report via Docmd.Openreport, but how do I close it after I updated the properties .Filter and .Filteron? Thank you. p.s. Opening each report, for 800+ customers, is very time-consuming also. It might take each report 1 minute to preview, times 800 customers, that's 800 minutes to process all customers. Which is why I wanted a direct way, without using Docmd.Openreport, to update the report properties directly. |
Thread Tools | |
Display Modes | |
|
|