sard0nicpan
Programmer
I don't want to set my record source for my forms/reports in the Properties box, but instead in VBA (by the way, its an Access Project front ending to Sql server DB).
On the Open (report) or Open (form) event I attempted the following:
As I left the subroutine, Access would declare that it could not find the record source or that it did not exist.
So what am I missing? When I manually type in the same thing in the Properties box, it works. However, I would like to code it programmatically because the Parameters that go with the stored procedure change dependent on conditions.
So I guess I have a few questions:
1. What have I missed?
2. On which events should I set the recordset for Forms/Reports?
Thanks in advance,
SP
On the Open (report) or Open (form) event I attempted the following:
Code:
Me.Report.RecordSource = "Exec dbo.spA1" & myParam
or
Me.mForm.RecordSource = "Exec dbo.spA1" & myParam
As I left the subroutine, Access would declare that it could not find the record source or that it did not exist.
So what am I missing? When I manually type in the same thing in the Properties box, it works. However, I would like to code it programmatically because the Parameters that go with the stored procedure change dependent on conditions.
So I guess I have a few questions:
1. What have I missed?
2. On which events should I set the recordset for Forms/Reports?
Thanks in advance,
SP