Form Control to display in Form or be invisible and other Controls to use space (1 Viewer)

PNGBill

Win10 Office Pro 2016
Local time
Tomorrow, 06:39
Joined
Jul 15, 2008
Messages
2,271
Hi Forum, MS Access 2010 accdb

In a Continuous Form I want to Include (or Not) a memo under each record.
If included, the Detail Height and a Line Top need to change ie, fill the space provided.

This code is half working. it appears even thought the Text Box control is Not Visible and its Height are changed (or should be) the Detail Height does not reduce.
Code:
If Me.cmdShowNotes.Caption = "Include Notes" Then
        Me.Detail.Height = 1.4
        Me.lineUnderBuildRecord.Top = 1.3
        Me.memBuildMemo.Height = 0.556
        Me.memBuildMemo.Visible = True
        Me.cmdShowNotes.Caption = "Hide Notes"
    ElseIf Me.cmdShowNotes.Caption = "Hide Notes" Then
        Me.memBuildMemo.Height = 0.001
        Me.Detail.Height = 0.7
        Me.lineUnderBuildRecord.Top = 0.6
        Me.memBuildMemo.Visible = False
        Me.cmdShowNotes.Caption = "Include Notes"
    End If

Appreciate any advice on how to resolve.
 

JHB

Have been here a while
Local time
Today, 18:39
Joined
Jun 17, 2012
Messages
7,732
I think you don't get/see the desire result because you need to use twips instead of inch., and One twip is 1/1440 inch. Try to set raise your values for detail section to 2000 and also the other controls to corresponding values.
 

PNGBill

Win10 Office Pro 2016
Local time
Tomorrow, 06:39
Joined
Jul 15, 2008
Messages
2,271
Thanks JHB. This advice helped with the Lines and Text but still have a problem with the Detail Section not shrinking.
Maybe Detail uses a different method ?
 

JHB

Have been here a while
Local time
Today, 18:39
Joined
Jun 17, 2012
Messages
7,732
No it should be the same, I've made a small sample for you, open the only form and hit the button.
If you still can't get it post a stripped version of your database, + info which form you have the problem.
 

Attachments

  • FormMemo.accdb
    488 KB · Views: 61

PNGBill

Win10 Office Pro 2016
Local time
Tomorrow, 06:39
Joined
Jul 15, 2008
Messages
2,271
Thanks JHB, Your sample works perfectly.
My problem may be the Line. I Will take my line. It may be preventing the Detail from shrinking.
I will try some more in 24 hours. Appreciate your assistance.:)
 

PNGBill

Win10 Office Pro 2016
Local time
Tomorrow, 06:39
Joined
Jul 15, 2008
Messages
2,271
I moved the Line to the Top of the Detail Section and took out any code to change it's position.
The Expand and contract facility works well now that it does not also need to move the line.
there should be a way to move the line but it appears fine at the top.:)
 

Users who are viewing this thread

Top Bottom