TableDef, RowHeight

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
 
D

Douglas J Steele

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

However, it shouldn't matter: you should never be working directly with the
tables.
 
Z

zamdrist

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

:)
 
Z

zamdrist

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

:)
 
A

Allen Browne

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.
 
Z

zamdrist

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top