Programmatic Control of Form Detail Height (1 Viewer)

Daveyk01

Registered User.
Local time
Yesterday, 18:15
Joined
Jul 3, 2007
Messages
144
I can't figure out why this doesn't work:

MyForm.Detail.Height = MyForm.Detail.Height - Int(0.75 * 1439.98848009216)

I have a start-up that if a data-logger is not detected, I move other various control a little higher as in:

Set MyForm = Forms!frmstartup
For Each CTL In MyForm.Controls
If InStr(CTL.Tag, "NOLOGGER") > 0 Then CTL.Visible = False
Next
'
For Each CTL In MyForm.Controls
If InStr(CTL.Tag, "SHIFTUP") > 0 Then CTL.Top = CTL.Top - (0.75 * 1439.98848009216)
Next
'
MyForm.Detail.Height = MyForm.Detail.Height - Int(0.75 * 1439.98848009216)

The only problem is that the control of the overall detail section height does not work. If I break point the code, and check the detail height, the result is .75" shorter that it had been. When the form is actually seen it is the same size it was designed at.

Any ideas?:confused:

Dave
 

MarkK

bit cruncher
Local time
Yesterday, 18:15
Joined
Mar 17, 2004
Messages
8,187
Hey there,
Set the InsideHeight property of the form.
 

Daveyk01

Registered User.
Local time
Yesterday, 18:15
Joined
Jul 3, 2007
Messages
144
Hey there,
Set the InsideHeight property of the form.

Wonderfull!! That worked great. Thank you so much! :)

I have designed reports that dynamically move fields up based on other fields not having data and then resizing the detail section. On the reports it works great but not on the forms. InsideHeight did not occure to me; wow, again thank you.
 

MarkK

bit cruncher
Local time
Yesterday, 18:15
Joined
Mar 17, 2004
Messages
8,187
Yeah, you bet. As I'm sure you're finding, the size of a form's sections (header, detail, footer) are not that tightly coupled with the size of the window that contains them.
Cheers,
 

Users who are viewing this thread

Top Bottom