Expanding and Collapsing within a form (1 Viewer)

Dazz45

New member
Local time
Today, 05:16
Joined
Mar 18, 2021
Messages
6
Hi
I am working on a database for my girlfriend who runs her own care company. On a form the requirement is to have various questions underneath each other on the form. So far using Zak14's handy tutorial page.266738 (Thanks Zak) I have managed to create a semi-working form as illustrated in image1. As you can see the 2nd question appears correctly under the 1st question. Question 3 appears incorrectly half way down the page. On clicking the plus next to question 1 it drops down a further set of options and correctly moves question 2 down to accomodate (image2), question 3 is still halfway down the page inversly proportionate to the second questions dropdown questions. At this point it is desired to have question 3 directly beneath question2. Whilst question1 is still expanded and upon clicking on question 2 it's further options drop down correctly
(image4). As every main questions dropdown options occupy the same space as the one above question 3 is still further down the page (image3). On collapsing question1 and expanding question 2 the further options appear down the page (image5). On expanding all three questions, all of the options occupy the space correctly except question3 is hidden by the end of it's options although there is a space where it should go.
 

Attachments

  • Image1.jpg
    Image1.jpg
    16.9 KB · Views: 136
  • Image2.jpg
    Image2.jpg
    34.8 KB · Views: 154
  • Image3.jpg
    Image3.jpg
    45.7 KB · Views: 147
  • Image4.jpg
    Image4.jpg
    50.2 KB · Views: 136
  • Image5.jpg
    Image5.jpg
    30 KB · Views: 152

Dazz45

New member
Local time
Today, 05:16
Joined
Mar 18, 2021
Messages
6
To acheive this I have basically duplicated Zak's VB code 3 times and added the required tags etc into the properties, unfortunately I have very little comprehension of VB code. I have posted the code in the hope that someone could help me out or suggest where I may be going wrong.
Thanks in advance for any help.
 

Dazz45

New member
Local time
Today, 05:16
Joined
Mar 18, 2021
Messages
6
Trying to post the code here but it won't let me perhaps an admin can help
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 00:16
Joined
Feb 19, 2002
Messages
32,908
The site has been having problems since the new version got installed a week or two ago. put the code in a text file and attach that.

I'm going to suggest a different approach that does not require moving stuff on the fly. I'll post a picture. It is a main form with three subforms. The left form is a list. That could be the questions. The top form on the right is the detail. When you click on an item in the list, the related detail shows in the top right form. And in my example, the middle subform also has a list subform. The top bar filters the list but I don't think you would need that. If the "details are different. it is possible to use different subforms in the place of the details subform. You would just need something in the list table that indicated which subform to load.
ThreeSubforms.JPG
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:16
Joined
May 7, 2009
Messages
13,784
i would love to see the code!
on the meantime, it kept me busy to "mimic" the "xp style menu".
 

Attachments

  • xp style menu.accdb
    876 KB · Views: 69

Dazz45

New member
Local time
Today, 05:16
Joined
Mar 18, 2021
Messages
6
The site has been having problems since the new version got installed a week or two ago. put the code in a text file and attach that.

I'm going to suggest a different approach that does not require moving stuff on the fly. I'll post a picture. It is a main form with three subforms. The left form is a list. That could be the questions. The top form on the right is the detail. When you click on an item in the list, the related detail shows in the top right form. And in my example, the middle subform also has a list subform. The top bar filters the list but I don't think you would need that. If the "details are different. it is possible to use different subforms in the place of the details subform. You would just need something in the list table that indicated which subform to load. View attachment 90086
Thank you Pat, I shall investigate your recommendation, if I have no joy with my current modus operandia, I am currently investigating Arnelgp's suggestion as it seems similar to where I already am.
 

Dazz45

New member
Local time
Today, 05:16
Joined
Mar 18, 2021
Messages
6
i would love to see the code!
on the meantime, it kept me busy to "mimic" the "xp style menu".

Thank you Arnel, I was kind of hoping that you would reply to my post as I noticed that you were a respondant to the original post by Zak14. I am presently trying to incorporate your idea into my db. So far so good, I'm struggling to see where the form data for the second question is defined but thank you for your assistance. I hope that I will be able to give you a shout if I really can't get it. As I said earlier my experience with vb coding is non-existant so I would appreciate your help.
Kind regards
Dazz
 

isladogs

CID VIP
Local time
Today, 05:16
Joined
Jan 14, 2017
Messages
15,294
I don't remember the original thread so I'm not exactly sure what you are asking.
See if either of the attached simple example apps are of any use to you
 

Attachments

  • SubformShrink&Grow_v3.zip
    54.7 KB · Views: 80
  • SubdatasheetExpandCollapse.zip
    37.8 KB · Views: 159

Users who are viewing this thread

Top Bottom