ctrl.height

G

Guest

Hi,
This method change the hieght and Width of the sub form in the form calling
in
form resize event.
I don't know what is 6615 parameter meens
ctrl.height = fHight - 6615 + DEF_H

Code Snippet
Sub sub_forms_hieght(frm As Form)
Dim FLeft As Long
Dim FTop As Long
Dim fHight As Long
Dim FWidth As Long
Dim ctrl As Control
Const DEF_H = 3850
Const DEF_W = 7335

Call GetFormDimensions(frm, FLeft, FTop, FWidth, fHight)
If (FWidth < 3000) Or (fHight < 3000) Then

For Each ctrl In frm.Controls
If ctrl.ControlType = acSubform Then
DoCmd.Beep
DoCmd.MoveSize 1060, 1510, 7890, 6615
ctrl.Width= DEF_W
ctrl.height = DEF_H
End If
Next
frm.Refresh
Exit Sub
End If

For Each ctrl In frm.Controls
If ctrl.ControlType = acSubform Then
ctrl.height = fHight - 6615 + DEF_H
ctrl.Width = FWidth - 7890 + DEF_W
End If
Next
End Sub

VBA + Access.
Thank's,
Yael
 
B

BruceM

That number is probably twips, which is a twentieth of a point. I don't
know of any way to change that, but there may be regional settings of which
I am unaware. There are 72 points per inch, so there are 1440 twips per
inch (or about 567 per centimeter). Convenient, isn't it? I often multiply
the actual measurment by 1440. For instance, 1.5 inches would be 1.5 *
1440.
 
G

Guest

Hi, Thank's for your replay.
My ask is why 6615 number? why not 6616 or 5000..? what this parameter
meens? why shuld I sub it like this:
ctrl.height = fHight - 6615 + DEF_H
 
B

BruceM

6615 is a specific measurement. Somebody must have thought it was the right
size for something. You wouldn't have noticed the difference had it been
6616. 5000 would be a little more than an inch smaller than 6615.

Then there is Sub sub_forms_hieght(frm As Form), which defines some
variables such as FLeft, but doesn't seem to assign them values in the code
fragment you have provided. These variables are used in a user-defined
function named GetFormDimensions. I can't understand why a constant is
being added to a number. DEF_H = 3850, so 6615 + 3850 is 10465. fHight is
maybe the height of the form, so the subform control height (ctrl.height =
fHight - 6615 + DEF_H) is the form height - 10465, or about 7.25 inches less
than the form height.
 

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