G
Guest
I have a form that displays a bunch of information to the user. On the form,
I have two command buttons that fire off a series of actions. The last action
in the click event of each of these buttons is to open a form, which contains
a couple of subforms, the difference being the RecordSource for the two
subforms. When I click one of the buttons, and execute code that looks like
the following, it executes properly. When I click the other button, I change
the record source for the two subforms, but I get an error indicating that
the form cannot be found. I have checked to make sure that the code is
identical, only the name of the queries change between the two subroutines.
Private sub Button1_Click
'do something here
forms("frm_Report_rollup").RecordSource = "qry_rollup"
forms("frm_Report_details").RecordSource = "qry_details"
docmd.openreport "MyReport"
end sub
I have two command buttons that fire off a series of actions. The last action
in the click event of each of these buttons is to open a form, which contains
a couple of subforms, the difference being the RecordSource for the two
subforms. When I click one of the buttons, and execute code that looks like
the following, it executes properly. When I click the other button, I change
the record source for the two subforms, but I get an error indicating that
the form cannot be found. I have checked to make sure that the code is
identical, only the name of the queries change between the two subroutines.
Private sub Button1_Click
'do something here
forms("frm_Report_rollup").RecordSource = "qry_rollup"
forms("frm_Report_details").RecordSource = "qry_details"
docmd.openreport "MyReport"
end sub