Programmatic Control of Form Detail Height

Daveyk01

Registered User.
Local time
Today, 02:10
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
 
Hey there,
Set the InsideHeight property of the form.
 
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.
 
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

Back
Top Bottom