They will need to build a query to do that. An Append query, or if the
columns will change, a Make-Table query are the query types that you will
need to teach them to make. There are no events for Associated (attached)
labels. Attached labels are the ones which will show in a datasheet column
header. If there is no attached label, the field name is used for a label on
a datasheet.

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
Hi Arvin
Thanks for the reply. Not sure whether I am misinterpreting your answer or
you haven't understood my question. Can I just clarify what I'm doing.
My users have a list box filled with Excel file names that are in a specific
folder on the computer. When they select one of these docs, the entire
spreadsheet is imported into an Access table called tblTempData. The field
names in this table are Field1,Field2,Field3 etc.
I have this part working.
On the form they are using is a subform/datasheet with the new imported data
displayed. When a user highlights a column (eg Field1) I would like to
store 'Field1' into a variable. All I need to know is the name of the column
they have highlighted. Is this possible?
I did read on a newsgroup thread that the process may be achieved by setting
the variable in the GotFocus event. I haven't actually tried this yet but
wondered if this is the only way to achieve the above. My database is an
.mde file.
Thanks
Sandy
> They will need to build a query to do that. An Append query, or if the
> columns will change, a Make-Table query are the query types that you will
[quoted text clipped - 12 lines]
>> Thanks in advance
>> Sandy
fredg - 03 Jun 2007 17:11 GMT
> Hi Arvin
> Thanks for the reply. Not sure whether I am misinterpreting your answer or
[quoted text clipped - 35 lines]
>>> Thanks in advance
>>> Sandy
Not by highlighting th entire row.
If all you need is the name of the column, code EACH Field control's
Enter event:
MyVariable = Me.ActiveControl.Name
But first....
Declare MyVariable up in the code window's General Declarations
section so that it is available in all of this form's events.
Option Compare Database
Option Explicit
Dim MyVariable as String
MyVariable will be whatever field the cursor has last been (or
currently is) in.

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Arvin Meyer [MVP] - 05 Jun 2007 03:08 GMT
There is no way when selecting a column of data. If the cursor were placed
within a field on any row, you could use the GotFocus event, LostFocus even,
or the Enter or Exit events to write that field's name to a table or a file.

Signature
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
> Hi Arvin
> Thanks for the reply. Not sure whether I am misinterpreting your answer or
[quoted text clipped - 35 lines]
>>> Thanks in advance
>>> Sandy