var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Re-sizing table field width (in VBA only)
i have a form that has a table in a subform, is there a way i can have it so when the form is opened the tables field width are pre-set?
i need to set this everytime the form is opened because the table is constantly being droped and created again using DoCmd.RunSQL...
Sorry, your question isn't absolutely clear for me. Do you want to set up the size of your control (textbox or whatever) in your form or the size of the fields in the tables?
For resizing the controls in the form (what i guess you want to do) use:
dim frm as form
dim ctrl as control
If you want to resize within the table, you can't do this on a form basing on the table. You have ro close it first and then work on the tabledef object.
it's resizing the table columns width in VBA
It's the actual columns width of a table....
AuthorisationForm.SourceObject = "Table.AuthorisationSection_EPRNo_" & EPRNo & ""
....to make an object on a form into a table (depending on the EPRNo variable), but i want to set the width of the columns within that table?
can it be done?
Yes, look for the tabledef:
set db = currentdb
set td = db.tabledefs(yourtable)
i'm totally new to this could you give me an example of the table def....?
Private Sub Form_Open(Cancel As Integer)
' sets an unbound object as the table StaffDetails table
tableOnForm.SourceObject = "Table.StaffDetails"
Set db = CurrentDb
Set td = db.tabledefs("StaffDetails")
td.Fields("StaffID").Width = 2345
i added your snippet, but it says ....
object doesn't support this property or method??
Hmm, my fault - the tabledef object has a property called properties where you can define the width. Normally you have to create this property first, so check the helpfile for td.fields(x).createproperty(width)