Formatting column widths and captions/column headings on a datasheet view subform (1 Viewer)

jumnhy

Member
Local time
Today, 05:37
Joined
Feb 25, 2021
Messages
68
Hello all,

Trying to figure out how to configure two parts of a subform that I'm displaying in datasheet view--making the column widths persistent, and customizing the column names as they appear on the datasheet.

The recordsource is a query that's an amalgam of various joins from several tables. The issue is that despite aliasing the column names in the final query, the names displayed on the columns in the datasheet view persist as the underlying column headings from the upstream queries and tables. I'm just beginning to backtrack which upstream recordsources are persisting from where, so I can change them there if needed and allow those changes to persist, but I'm hoping/assuming there's something I don't know, and I'd think it should be possible to coerce them to read as whatever I want.

How can I set the column names in the datasheet view? I know that configuration options for the datasheet view are limited, and while I've considered just converting to a continuous form, I like the look and familiar feel of the datasheet for our end users, and the inbuilt search/sort/filter features that it provides.

Similarly, if I manually set the widths of the columns, they seem to reset once viewed on the actual subform--ie, if I edit the subform itself separately in datasheet view, those changes don't persist when viewed live as part of the parent form. Read elsewhere something about "freezing" the column width, but when I do that the columns appear to rearrange (pulls the frozen column to the leftmost spot). Is there a better way to configure this?

I'm hoping to avoid needing to rework the subform as a continuous form view, so any input would be very helpful.
 

jumnhy

Member
Local time
Today, 05:37
Joined
Feb 25, 2021
Messages
68
I'll add for anyone else that stumbles across this: your column names on the datasheet are the control names. Key takeaway from that article is that datasheets are just forms, and many of the properties of them are configurable just like any other form. Name your controls what you want the column heading to appear as.

This is a bit concerning, just because sometimes you'd want to reference a control using a convenient naming scheme, but would be "forced" into naming it whatever you needed to display instead... If you choose to go with a datasheet view, etc etc etc
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 05:37
Joined
May 21, 2018
Messages
8,525
In the datasheet recordsource set the caption property of the field. You can do this on any table or query.
Screenshot_20210318-091415.png
 

jumnhy

Member
Local time
Today, 05:37
Joined
Feb 25, 2021
Messages
68
Lol I totally missed that. I was looking for "Caption" and totally skimmed over "Datasheet Caption" every time I looked at the properties sheet. Little things. Thanks again!
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 05:37
Joined
May 21, 2018
Messages
8,525
FYI if you do this when you make your table it shows up everywhere in the database such as labels and queries.
 

jumnhy

Member
Local time
Today, 05:37
Joined
Feb 25, 2021
Messages
68
Yeah, that was my issue previously--it would appear (I'm not sure) that if you just alias the column name in the query, the caption persists in the datasheet view.

I ended up doing it at the control level rather than the table because I need a different caption here.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:37
Joined
Feb 19, 2002
Messages
43,213
I think Access may be handling the Caption properly now. Earlier versions sure didn't so I was never able to use them. The other method is to just change the caption property of the associated label control. NOTE - this only works if the labels are associated with a control. The design view is the top picture and the DS view is the bottom picture.
DSSubform.JPG
 

Users who are viewing this thread

Top Bottom