Show or No Show

  • Thread starter Thread starter DDBeards
  • Start date Start date
D

DDBeards

I have a continuous form consisting of 1 row of infomation. I want to put a
button in the form heading that shows comments or hide comments. I would
like to make visible or hide comments based on the button selection. I can
do that, but what I want to also happen is the height of the detail row to
shrink or grow based on the selection. If comments are to be shown, I want
the detail to be .5" height if comments are not to be shown, I want the
detail to be .25". Can someone please help

DDBeards
 
One way to do this is to place the comments text box in the Form Footer
section.

Your command button then toggles the Visible property of the section.
 
This is generally pretty easy.

In design view, set your comments text box height to what ever your other
textbox height is set to (I'm using .2 in my example below).

Then, in the click event of your comments button (cmd_Comments). Do
something like:

Private Sub cmd_Comments_Click

if me.cmd_Comments.Caption = "Show &Comments" Then
me.section(acDetail).height = .5 * 1440
me.txt_Comments.height = .4 * 1440
me.txt_Comments.visible = true
me.cmd_Comments.Caption = "Hide &Comments"
Else
me.txt_Comments.visible = false
me.txt_Comments.height = .2 * 1440
me.section(acDetail).height = .25 * 1440
me.cmd_Comments.Caption = "Show &Comments"
Endif

End Sub
--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
Thank you, This works great accept that the conditional formating that works
fine when the form is loaded does not work after shrinking the comments. Any
idea on this one. I tried repaint

DDBeards
 
No idea. Have not tried this technique with conditional formatting.

Does the conditional formatting work when you start out, and when you expand
it, but not when you shrink it again?

--
Dale

email address is invalid
Please reply to newsgroup only.
 
Back
Top