Solved How to Set Form Detail Height Through VBA (1 Viewer)

Pac-Man

Active member
Local time
Tomorrow, 03:38
Joined
Apr 14, 2020
Messages
408
Hello,

How to set height of detail section of the form on load event when certain condition is met (so that for that condition, extra buttons could be displayed). I tried
Code:
Me.Detail.Height = 5800
but visibility height of the form it's not increased in load however when I run following code using a button
Code:
MsgBox Me.Detail.Height
Message box shown the detail 5800. I tried extremely larger value too but MsgBox show height that I set using code but visible height of detail remain same. How can I change height of detail on form load?

Best Regards
Abdullah
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:38
Joined
Oct 29, 2018
Messages
21,358
Hi. Just a guess, have you tried using MoveSize?
 

Pac-Man

Active member
Local time
Tomorrow, 03:38
Joined
Apr 14, 2020
Messages
408
Hi. Just a guess, have you tried using MoveSize?
Thanks for reply @theDBguy No, I didn't try move. Can detail section move? I am not in front of PC right now else I would try it right away.
 

Micron

AWF VIP
Local time
Today, 18:38
Joined
Oct 20, 2018
Messages
3,476
If you increase the detail section size but not the height of the form, you should be introducing vertical scroll bar if not already there. If you've set scroll bars to none, you're not going to get this to work. If scroll bars are allowed, you must not be noticing them when the detail section increases - perhaps because they're already there.

What might work is if you set focus to a control that's below the lowest point you can see controls, but I do not think it will work if you can't scroll the detail section.
 

Pac-Man

Active member
Local time
Tomorrow, 03:38
Joined
Apr 14, 2020
Messages
408
If you increase the detail section size but not the height of the form, you should be introducing vertical scroll bar if not already there. If you've set scroll bars to none, you're not going to get this to work. If scroll bars are allowed, you must not be noticing them when the detail section increases - perhaps because they're already there.

What might work is if you set focus to a control that's below the lowest point you can see controls, but I do not think it will work if you can't scroll the detail section.
Thanks for reply. As you suggested, I increased the form height using insideheight and it worked. Thanks again.
 

Users who are viewing this thread

Top Bottom