Scroll Bar Question.

LEXCERM

Registered User.
Local time
Today, 17:31
Joined
Apr 12, 2004
Messages
169
Hi All,

I have the following piece of code on my subfrom datasheet which re-formats the columns and rows either ON CURRENT or ON LOAD of the form:-

Dim Cntl As Control
For Each Cntl In Me.Form.Controls
Cntl.ColumnWidth = -2
Me.RowHeight = 250
Next Cntl

However, I find that if I activate the scroll bars of the subform, the above code does not work and it seems that scroll bars are not part of any form event i.e. ONGOTFOCUS, ONCURRENT etc. Is there some sort of a SCROLL BAR event or any coding that on activation will run this piece of code?

I need this because whenever the datasheet is on view, and a user scrolls down the page, the columns do not format as required unless you click in the datsheet itself (hence the ONCURRENT event).

Regards,
PAUL.
 
If you are talking about your form having the extra length, you have to calculate the height of your form.detail to match the size of smaller controls.

Either that or I cannot imagine what is the problem, you could create a jpg file from a print screen and send it to us.
 
Liv,

Thanks for the reply. My thread does read a bit confusing.

To simplify things, if I click in the subform itself, the ONCURRENT event code kicks in and auto-fits the datasheet columns to fit the data in each field exactly. However, if I click on the subform's scroll bar, the ONCURRENT event does nothing. It seems that the scroll bar does not take any type of FORM event, even though it's part of the subform.

Basically, I am looking to see if there is a SCROLL BAR event, i.e. if scrolling up or down the form, do this?

Regards,
PAUL.
 
I have been mucking around with column widths in several datasheet forms trying to set column widths to certain sizes with mixed success.I have had the best results by using the subforms on click event and on dlbclick event but it doesnt always fire either.It seems to me access must store column values that cannot be over rided.
Have you tried using the subforms click event
Regards
Bjackson
 

Users who are viewing this thread

Back
Top Bottom