Variable Field Name in Datasheet Veiw

  • Thread starter Thread starter William
  • Start date Start date
W

William

Can the field name in a query be setup as a variable such
that in the query datasheet view, the resulting field
name could change based on input to the query?
This would be like having the Caption for the field name
be a variable.

I have a situation where there are multiple
databases where the table designs are the same. The table
field names are the same in each database and have
generic names such as F1, F2, etc. In each database there
is a reference table that defines the field name for F1,
F2, etc. These names may vary between databases.
I would like to setup a generic query that I could copy
to each database that would extract the data with the
correct field names in the datasheet view based on the
particular reference table associated with each database.

Is there any established code that would
accomplish this?
Thanks in advance.
 
For a query, or even a form's, datasheet view, you could change the captions
of the desired fields. Open the querydef in VBA, and then set the property
in code. I think this might be easier using a form datasheet than a
query's.

--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Back
Top