P
phillip9
Hello,
I'm hoping somone will be willing to help me with this question.
I have a generic report that could be used with various data sources and
queries, depending on what the user selects from a drop-down list. How can I
change the reports record source and label using VBA?
I have been trying to use the following, but get errors about the form not
being open or not using the correct name.
' error I get is:
run-time error '2451':
the report name 'projectschedule' you entered is misspelled or refers to a
report that isn't open or doesn't exist.
'---examples I have been trying to use ----
[Reports]![ProjectSchedule]!RecordSource = cboProjectList.Value
DoCmd.OpenReport "ProjectSchedule", acViewPreview
[Reports]![ProjectSchedule].Controls!ProjectScheduleLabel =
cboProjectList.Value
If I have left anything out, please let me know.
Thank you,
Phill
System information:
Windows xp pro
Access 2003
All service packs & patches installed for Windows xp & office 2003
I'm hoping somone will be willing to help me with this question.
I have a generic report that could be used with various data sources and
queries, depending on what the user selects from a drop-down list. How can I
change the reports record source and label using VBA?
I have been trying to use the following, but get errors about the form not
being open or not using the correct name.
' error I get is:
run-time error '2451':
the report name 'projectschedule' you entered is misspelled or refers to a
report that isn't open or doesn't exist.
'---examples I have been trying to use ----
[Reports]![ProjectSchedule]!RecordSource = cboProjectList.Value
DoCmd.OpenReport "ProjectSchedule", acViewPreview
[Reports]![ProjectSchedule].Controls!ProjectScheduleLabel =
cboProjectList.Value
If I have left anything out, please let me know.
Thank you,
Phill
System information:
Windows xp pro
Access 2003
All service packs & patches installed for Windows xp & office 2003