Control Source Name (1 Viewer)

RJW

Registered User.
Local time
Today, 07:14
Joined
Sep 21, 2006
Messages
44
Trying to create a Report, it's source is a query "QSpecificYear"

Depending on which year is picked on a Form, the names of two fields in the query change.

Example:
If year 2013, the field names are ... FirstName,LastName,PledgedAmount,2,3

If year 2014, the field names are ... FirstName,LastName,PledgedAmount,4,5

For Control Source in the Report can use something like a Column Number ... Column(4) instead of the name?

Thanks


Thanks
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 12:14
Joined
Jul 9, 2003
Messages
16,271
Trying to create a Report, it's source is a query "QSpecificYear"



Depending on which year is picked on a Form, the names of two fields in the query change.



Example:

If year 2013, the field names are ... FirstName,LastName,PledgedAmount,2,3



If year 2014, the field names are ... FirstName,LastName,PledgedAmount,4,5



For Control Source in the Report can use something like a Column Number ... Column(4) instead of the name?



Thanks





Thanks
I don't get it?

Sent from my SM-G925F using Tapatalk
 

jdraw

Super Moderator
Staff member
Local time
Today, 07:14
Joined
Jan 23, 2006
Messages
15,379
Perhaps you could show us a sample with data of what you are trying to describe.
I'm with Uncle Gizmo--confused why column headers change??
 

RJW

Registered User.
Local time
Today, 07:14
Joined
Sep 21, 2006
Messages
44
The query "QSpecificYear" is a Crosstab query.

The names of the fields in the query change based on input from a Form.

I'm using that query as a source for a Report.

If the year 2013 is chosen on the Form, The fourth and fifth field in the query are labeled "2" and "3"

If year 2014 is picked, the 4th & 5th field in the query is labeled "4" and "5"

How do I reference the fields in my report if the name of the fields change.

I was hoping to build one Report that could handle all the different years.


Does that help
 

RJW

Registered User.
Local time
Today, 07:14
Joined
Sep 21, 2006
Messages
44
I'm not a programmer. I could not do that.

I build almost exclusively in Design mode & I google for a lot of VBA code.

I have only 7 years. I'll build 7 reports and based on the year picked I'll put code in the "View Report" button to pick the specific Report.

Thanks for helping everyone.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:14
Joined
Oct 29, 2018
Messages
21,454
Right. For now, that would definitely be easier for you. Good luck!
 

Users who are viewing this thread

Top Bottom