Table Datasheet View - Autofit

dvent

Registered User.
Local time
Today, 21:16
Joined
Jul 14, 2009
Messages
40
Hi All,

When a user clicks a button in my access database a table is shown.

I want this table to have all columns wide enough to fit the column headers by default. Can anyone explain how to do this?

Current code:

Application.DoCmd.OpenTable "NiceLookingMasterData", acViewNormal

Thanks
dvent
 
Open your table and widen the column as you would in Excel.
 
oumahexi - can this be built into my code? my users do not want to have to select columns and widen them.
 
Users should never see your tables. You should display the data in Forms or Reports
 
Users should never see your tables. You should display the data in Forms or Reports

My users want to see the tables to do some ad-hoc filtering etc. Thats where I'm a bit stuck.
 
You can't do anything with the tables, but you can do something with a datasheet form that LOOKS like a table.
 
Can users use the datasheet view to filter etc I'm guessing? I'll not be back on the machine with Access for a bit.

I'm guessing I amend my code to say acDatasheet or something?
 
Yes, they can filter and can filter using the filter buttons and all, or you could set up other ways to filter.
 
Is there an equivalent of Cells.Autofit in Excel that I can use in Access anyone?
 
i would repeat what rabbie says

"users should never see tables"

---------
even as a developer, i would not normally look at a table, unless to fix it, or review it in the case of a problem.

but its your (your company's) system - access was obviously originally intended as a user programme, like excel - so if your users are competent, let them mess with yuor tables

but if you want to protect and ensure the integrity of the data, this isnt what you want to do - instead, if the users want to play with data, export it in a spreadsheet - then they can do whatever they want with the spreadsheet.
 
Is there an equivalent of Cells.Autofit in Excel that I can use in Access anyone?
Yes, there is something like that. I did it on a previous contract a couple of years ago and I have a copy at home. I can't tell you what it is exactly right now, but I can go look it up.
 
i would repeat what rabbie says

"users should never see tables"
But you can provide them a form that LOOKS like they are looking at a table and therefore have all of the events, validation, locking, etc. that you don't have when using a table directly.
 

Users who are viewing this thread

Back
Top Bottom