Width of record selector in datasheets

R

Rob

Hi all,

I have been trying to get a bit of code together to automatically resize the
columns of a datasheet in a subform. After some research I found the
ColumnWidth property and can now programatically change the size of the
columns. The issue is that they are too wide as I cannot account for the
size of the record selector. I have played with a constant, but I would like
it to be dynamic. Could anybody offer any suggestions as to how to measure
the width of the record selector?

I have included my current code snippet.

Cheers
Rob
---------------------------------------------------------------------
Private Sub Form_Resize()
Me.txtTaskID.ColumnWidth = -2 ' Best fit
Me.txtStatus.ColumnWidth = -2
Me.txtTaskTitle.ColumnWidth = Me.InsideWidth - Me.txtTaskID.ColumnWidth -
Me.txtStatus.ColumnWidth ' - width of record selector?
End Sub
 
T

Tom van Stiphout

On Wed, 18 Mar 2009 05:00:12 -0700, Rob

There is no constant defined for that, nor can you get it with a
Windows API call (because this is a custom control). Use your own
constant by trial and error.

-Tom.
Microsoft Access MVP
 
R

Rob

Hi Tom,

Thanks for the response. I ended up using a constant of 280 for my liking,
although I will have to test against the range of desktop configurations in
the office!

Cheers
Rob
 

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