TableDef, RowHeight

  • Thread starter Thread starter zamdrist
  • Start date Start date
Z

zamdrist

I am trying to create and append a property for a table's datasheet row
height (not a form datasheet view), but not having any luck. I have
also tried using code that assumes the existence of the property, as it
seems as it does, and that doesn't work either.

Dim pProperty As DAO.Property
Dim tdf As DAO.TableDefs

Set tdf = CurrentDb.TableDefs("tblWorkflow_New")

Set pProperty = tdf.CreateProperty("RowHeight", dbInteger, 35)
tdf.Properties.Append pProperty

'Or Just...

CurrentDB.TableDefs("tblWorkflow_New").Properties("RowHeight").Value =
35

Neither appears to work, have tried several variations. No error is
returned at all...just quietly executes the code...but no
results...thought, ideas?

Thanks
 
I don't believe it's possible to set.

However, it shouldn't matter: you should never be working directly with the
tables.
 
Nevermind, I'm a knucklehead.

I was running my code in a form module (class module) and therefore
since the class module wasn't initialized, the code doesn't actually
run. After I put the code in a basic module, it runs fine.

Me.Idiot

:)
 
Nevermind, I'm a knucklehead.

I was running my code in a form module (class module) and therefore
since the class module wasn't initialized, the code doesn't actually
run. After I put the code in a basic module, it runs fine.

Me.Idiot

:)
 
Your approach looks fine.

You are creating the right type of property, correctly named, on the right
object, though in your first example you might need to create a Database
variable so that CurrentDb does not go out of scope.

35 is way small: 240 twips would be 1/6 inch.

Also, you would need to do this while the table is not open.
 
Thanks, I got it working now, see my followup post :-S

I see also a 1440 twips = 1 inch, so yeah I raised that a bit :)
 
Back
Top