Form is too long (1 Viewer)

PeteB

Registered User.
Local time
Yesterday, 20:19
Joined
Mar 15, 2016
Messages
78
I have an 'Alert' form (continuous form) set to pop up in front of the navigation form when the database opens with two hyperlinks set at the bottom edge of the form.
Currently the length (vertical height) of the form is full height of the window which means that the hyperlinks are not visible.
Although it is a continuous form, it doesn't need to be so long as there are never likely to be too many records on it.
Is there a way of setting the form so that it is, say, 10cm tall? I, as an amateur, can't find one and would appreciate help.
 

AccessBlaster

Registered User.
Local time
Yesterday, 20:19
Joined
May 22, 2010
Messages
5,917
Try moving the hyper link to the "form footer" or "form header".
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 23:19
Joined
Feb 19, 2002
Messages
43,223
You can control the height of the form. Open it in design view and size it to the height you want. Save it. If you don't have any code that is changing the size, it will stay as you last saved it.

If that didn't help, please post a picture so we can see the problem.
 

PeteB

Registered User.
Local time
Yesterday, 20:19
Joined
Mar 15, 2016
Messages
78
Pat/Access Blaster
Thanks for trying.
When in design view, the form is only 4.3cm in height (as short as it possibly can be) and the hyperlinks are already in the form footer but when I then switch to form view the form stretches to that shown in attached screen grab (full height of window).

Moreover, as I understand it there is no property in Access that allows you to set the height of a form, only the component parts i.e. header/detail/footer, unless code is used as an event procedure in the 'On Format' property, and this is where I faulter as I have very limited knowledge of code.
More help needed please.
 

Attachments

  • Doc1.docx
    46.8 KB · Views: 100

MarkK

bit cruncher
Local time
Yesterday, 20:19
Joined
Mar 17, 2004
Messages
8,179
A form has an AutoResize property. Has that been turned off? What if you resize the form when it is open, close it, then reopen it? Does it not open to the size it was when you last closed it?
Mark
 

PeteB

Registered User.
Local time
Yesterday, 20:19
Joined
Mar 15, 2016
Messages
78
Hi Mark
It has taken me this long to find out how to resize the form vertically but have now done that (in datasheet view) and thanks to your suggestion have succeeded in resizing -it's often the simple solution that works.

Many thanks.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 22:19
Joined
Feb 28, 2001
Messages
27,140
Moreover, as I understand it there is no property in Access that allows you to set the height of a form

Not true. Form.Height does that. Works fine.

BUT remember that everything visual in Access anchors from the top left corner. The size of a control comes from the the Height and Width properties. And here is where you might have thought that you can't set form height. The truth is that Access will not allow you to set the height of a form to be shorter than the bottom edge of that control on the form whose bottom edge is farthest from the top of the form. And the corresponding statement is true for width. You cannot adjust the width of a form to be narrower than the right-most edge of the control for which the right edge is farthest from the left edge of the form.
 

PeteB

Registered User.
Local time
Yesterday, 20:19
Joined
Mar 15, 2016
Messages
78
Hi Doc_Man
Thanks for your interest.

I understand what you say about the sizing of the component parts of a form and how they influence the overall size but Form.Height is not available as a property in either design or layout views so how do you set it? Remember, I am an amateur not an expert.
 

June7

AWF VIP
Local time
Yesterday, 19:19
Joined
Mar 9, 2014
Messages
5,465
Well Doc, I am not finding form height property in VBA. Could you show some sample code?

Peter, unfortunately I can't replicate your issue.
 

missinglinq

AWF VIP
Local time
Yesterday, 23:19
Joined
Jun 20, 2003
Messages
6,423
I'm betting that you have your db set to the default of Tabbed Documents. Try going to

Options - Current Database - Document Window Options

and change from Tabbed Documents to Overlapping Windows. Follow the popup dialog box to close then reopen Access, and see what happens when you try resizing the Form in Design View.

Like June7 and PeteB, I can find no way (in v2003 or v2007) to set the Form Height...only Form Width. And when you think about...what good would it be to be able to set each Section's Height, if it could be over-ridden by an overall Form Height?

Linq ;0)>
 

Gasman

Enthusiastic Amateur
Local time
Today, 04:19
Joined
Sep 21, 2011
Messages
14,231
How about the code below?, that seems to lengthen/widen as you need.?
Code:
    Me.InsideHeight = 25450 'twips is the unit of measurement
    Me.InsideWidth = 15870
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 22:19
Joined
Feb 28, 2001
Messages
27,140
Interesting, because it makes me wonder how I did some of the things I did some time ago. However, after a bit more research on a newer version of Access, here is what I can find, and it is possible my old memory was a bit creaky. Linq's comments reminded me.

First, unlike a control, a form fills a window. The Object Browser reveals that the form's properties include a .WindowHeight and .WindowWidth, so there might be some things you could do with those properties.

Second, don't forget that forms can have sections - though we often just zero-out the heights of the header and footer sections in Form Design view. You CAN adjust the height of a section. The height of the form is the sum of the heights of its sections. Programmatically I would look for the form's Detail section and diddle with ITS height. The overall form DOES have a width and you can adjust that. All sections are the full width of the form (or report), so that probably carries over on reports. Diddle with report width but section height.

It may simply be that I forgot that I needed to dink with the section to change form height. If so, apologies for a cranky memory. I will point out, however, that it was something I've only had to do once a long time ago and I explicitly remember dealing with .Height, not .InsideHeight. I guess it was section height but form width that I used.
 

PeteB

Registered User.
Local time
Yesterday, 20:19
Joined
Mar 15, 2016
Messages
78
Great to see that my problem provoked some argument.
Thanks to all who pitched in with suggested solutions. I'll come back again soon.
 

Users who are viewing this thread

Top Bottom