Hi
I have a list box which contains different types of log entries. Each different log entry type has a different report that goes with it.
What I want to do is select an entry in the list box, and click on print, email, pdf or view report buttons, and the appropriate happens, selecting the associated report for the log type automatically.
I have a table with the logtype in it, and against that I have a DefaultReport field, which contains the name of the report that needs to be opened for that logtype.
I am getting the correct name for the report no problem at all, I have made sure that the name is right by going to rename report and copy and pasting it.
When it goes to open the report I get an error message - Run-Time error 3071, the expression is typed incorrectly or is to complex to be evaluated.
I have a debug line running to make sure I am pulling back the correct report name and I am.
I have tried putting the dlookup where the report name would normally go in the docmd.openreport and I have also tried using ReportToView as a String and putting that in the docmd.openreport, but to no joy.
I have tried it with and without " around the report name and still no joy, either in the table or by concatenating the dlookup with Chr(34) at either end of it, then it comes up saying the report cannot be found.
Some help please... something so simple and yet so hard arghhh
Thanks
I have a list box which contains different types of log entries. Each different log entry type has a different report that goes with it.
What I want to do is select an entry in the list box, and click on print, email, pdf or view report buttons, and the appropriate happens, selecting the associated report for the log type automatically.
I have a table with the logtype in it, and against that I have a DefaultReport field, which contains the name of the report that needs to be opened for that logtype.
I am getting the correct name for the report no problem at all, I have made sure that the name is right by going to rename report and copy and pasting it.
When it goes to open the report I get an error message - Run-Time error 3071, the expression is typed incorrectly or is to complex to be evaluated.
I have a debug line running to make sure I am pulling back the correct report name and I am.
I have tried putting the dlookup where the report name would normally go in the docmd.openreport and I have also tried using ReportToView as a String and putting that in the docmd.openreport, but to no joy.
I have tried it with and without " around the report name and still no joy, either in the table or by concatenating the dlookup with Chr(34) at either end of it, then it comes up saying the report cannot be found.
Some help please... something so simple and yet so hard arghhh
Thanks