Dynamic form length

S

Smiley

Is it possible to achieve a dynamic form length on continue form in 2 ways -

1. have a field which is in memo, would I expended the field length so that
the box become longer and display more information. However if there is no
data on the field, just remind what is was originally. ie. the display field
expand downward according to the contents.

2. If I have more records to be showed, extended the form longer to show all
record, instead of using the vertical scoll bar ?

Thanks
 
M

Marshall Barton

Smiley said:
Is it possible to achieve a dynamic form length on continue form in 2 ways -

1. have a field which is in memo, would I expended the field length so that
the box become longer and display more information. However if there is no
data on the field, just remind what is was originally. ie. the display field
expand downward according to the contents.

2. If I have more records to be showed, extended the form longer to show all
record, instead of using the vertical scoll bar ?


I don't think you can change a form's detail section Height.

You can adjust the form's size by setting it's InsideHeight
and InsideWidth properties. Note that the form's header and
footer section are drawn first and any leftover space is
allocated to the detail section.

To make the form adjust its height to the number of records
in its record source, use code along the lines of this air
code:

With Me.RecordsetClone
.MoveLast
If .RecordCount > 12 Then
lngRecs = 12
Else
lngRecs = .RecordCount
End If
End With

Me.InsideHeight = lngRecs * Me.Section(0).Height _
+ Me.Section(1).Height + Me.Section(2).Height

If the form does not have the header/footer sections, leave
that part out of the calculation.

You can also use the Resize event to adjust the text box's
width if the user drags the form's right edge:

Sub Form_Resize()
If Me. InsideWidth > Me.textbox.Left + 150 Then
Me.txtbox.Width = Me.InsideWidth - Me.txtbox.Left - 150
End If
End Sub
 
A

Albert D. Kallal

No, you can't really expand a text box on a form (they do in reports!!!).
The probelm here is that when you lay out your form..and expand the
box..does everything else move down....
move out of the way......

what will happen???

As for showing more reocrds, well, if you expaned the above form, then you
going have to scrroll (unless it fits on the screen alerady).

So, I would suggest for showing "more" repeating data...you simply use a
contineus form, and use the vertiacl scroll bar.....

You *can* actually re-size a contineus form in code...and it WILL expand. I
don't have handy code that does this, but I not a whole lot sure as to if
simply haveing the form larger in the first place is not a better soltuion.
(users get used to where things are on a form...and if you change the
size...then they have to change where they look for things).

So, here is some screen shots of "grids" of data in ms-access:

http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm

In theory, if you increased the size of a continues form...more data would
display. However, if you more records then what can fit on a screen, then
you have to scroll in any system you use. So, I not 100% sure this is help.

You could also change/set the height settings of your text box that has the
text in it...but, once again...what does that get you??? still have to
design and have a form that can display this data....making the form grow,
or shrink will not help).
 

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