auto bestfit table width in access using vb6

  • Thread starter Thread starter greenpeas
  • Start date Start date
G

greenpeas

Guest
When I open the table in access I can select column then use bestfit one by one. Can I do it using vb6 like click a command button. Then all the column width in that table will adjust automatically according to data width.

Where can I find code like this?

ths in advance
:)
 
I have something like in access VBA but in second line it said it need an object. any pro pls help I am new at this

DoCmd.OpenTable "F_DataSheet", acDesign, , , , acHidden
Tables![F_DataSheet]![Your-column-name].ColumnWidth = 500
DoCmd.Save acTable, "F_DataSheet"
DoCmd.Close acTable, "F_DataSheet"

"Tables!..." may not the correct syntax I dun know how to find out the right syntax. I only know "Forms![F_DataSheet]![Your-column-name].ColumnWidth = 500" will work.

ths very much
 

Users who are viewing this thread

Back
Top Bottom