S
SAC
Access 2003
I'd like the user to be able to choose whether to sort a report by one of
two criteria. I have a form with a dropdown box where they make the choice.
Depending on the choice, I'd like to set the caption of the first column of
the report to the choice and likewise set the control source of the first
column's textbox to the appropriate control source.
In the report_open event I am setting:
the recordsource for the report,
the Me.Grouplevel(0).Controlsource
and the label for the columns.
These work OK.
The record source is:
Me.RecordSource = "SELECT tblOrganization.NAME as OrgName,
tblOrganization.ADDRESS, tblOrganization.ZIPCODE FROM tblOrganization ORDER
BY tblOrganization.ZIPCODE;"
In setting the control source for the textboxes, I've tried
Me.txtNAME.ControlSource = [OrgName] but this does not work.
I get the error "Microsoft Office Access can't find the field '|' referred
to in your expression." Runtime error 2465.
What do I need to change?
Thanks for your help.
I'd like the user to be able to choose whether to sort a report by one of
two criteria. I have a form with a dropdown box where they make the choice.
Depending on the choice, I'd like to set the caption of the first column of
the report to the choice and likewise set the control source of the first
column's textbox to the appropriate control source.
In the report_open event I am setting:
the recordsource for the report,
the Me.Grouplevel(0).Controlsource
and the label for the columns.
These work OK.
The record source is:
Me.RecordSource = "SELECT tblOrganization.NAME as OrgName,
tblOrganization.ADDRESS, tblOrganization.ZIPCODE FROM tblOrganization ORDER
BY tblOrganization.ZIPCODE;"
In setting the control source for the textboxes, I've tried
Me.txtNAME.ControlSource = [OrgName] but this does not work.
I get the error "Microsoft Office Access can't find the field '|' referred
to in your expression." Runtime error 2465.
What do I need to change?
Thanks for your help.