• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 437
  • Last Modified:

MS-Access VB: Can I set RecordSource of a Report without opening it?

Hi all!

Anyone knows if its possible to set RecordSource of a Report in VB without opening it? When you try to do that you get an error:
"report name misspelled or not open yet"

When you set it AFTER the report is open, you get an error:
"Can't set a RecordSource to an open report"

This is almost like this joke, that a painter shows a painting with just some gray smear and calls it "Israelis crossing the red see" - and when someone ask him why nothing is there, he replies that the Israelis already crossed and the Egyptians didn't come yet ...:)

The only way I found around it is opening the report in design mode, changing the RecordSource and closing, quite an ugly way.

Thanks for the help!
Udi
0
udik
Asked:
udik
1 Solution
 
xSinbadCommented:
The best way to do this would be to base the report record source on a query and then change the query SQL prior to viewing the report.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now