raterus
asked on
Change a report's recordsource at runtime
Hello Experts!
I have "Report1", and sometimes I want the recordsource of Report1 to be Query "ABC", and sometimes I want the recordsource to be Query "XYZ".
I'm at the code right before I DoCmd.OpenReport, and I need to make this change. Can someone help me. I was trying to do this, but it didn't work.
stDocName = "Report1"
Application.Reports(stDocN ame).Recor dSource = "ABC"
DoCmd.OpenReport stDocName, acPreview
Oh yes, I'm using Access 97!
I have "Report1", and sometimes I want the recordsource of Report1 to be Query "ABC", and sometimes I want the recordsource to be Query "XYZ".
I'm at the code right before I DoCmd.OpenReport, and I need to make this change. Can someone help me. I was trying to do this, but it didn't work.
stDocName = "Report1"
Application.Reports(stDocN
DoCmd.OpenReport stDocName, acPreview
Oh yes, I'm using Access 97!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great help guys, I got it working exactly the way I needed it.
Glad to assist
ASKER