Full Version: Form with "more" to open additional options
UtterAccess Forums > Microsoft® Access > Access Forms
argeedblu
I have seen this in action a number of times but haven't been able to figure out how to implement it in an Access form.
That I want is a form that I am using as a menu, for example, to open and display only a portion of the options. This part of the form includes a "more" button that, when clicked, expands the form to display additional options. The second part may or may not have a "less" button that would collapse the form back to the abbreviated version.
Can anyone suggest a strategy for creating such a form.
Glenn
adaytay
Hiya Glenn,
think it should be fairly straightforward - will your form have a footer?
What I'm thinking is add the additional fields into the form footer but make that invisible on open. Add a button to the detail which says "More >>" or something.
When the button is clicked you then change the caption to "Less <<" or something, and make the form footer visible.
You could test if the form footer was visible as the button was clicked - and code it up this way.
I'll knock something up for you...
Ad
argeedblu
Thanks, Ad.
ounds like a workable approach. I hadn't thought about using the footer for this. I will look forward to seeing the example.
Glenn
adaytay
Well it should have been simple but for some reason it isn't - the approach I thought *would* work refuses to. :(
et me keep playing with a few settings and I'll have something shortly - hopefully!!
Ad
khaos
You could also put an indicator field on the table that has the menu choices. A yes/no field would suffice. As you hit the more/less button you change the underlying query return to either include all or just some of the options. Using this method the more/less can always be at the bottom of the form, say the footer. Just an idea but it sounds feasible.
en
argeedblu
Thanks Ken,
That I am looking for, however, is a form that has a certain size, say 3 x 3 , that expands to 3 x 5 when the more button is clicked. In effect, the bottom portion of the form is invisible unless the user clicks more. That way there isn't a lot of empty space where the additional options are not required.
Glenn
Garfieldm842
I think this is what Adaytay had in mind.
adaytay
Almost - that's what I'm working on.

I'm assuming the form is popup, though. (You know, like the find dialog) The main problem is that the form refuses to resize even if I tell it what height it needs to go to. Making the footer visible just superimposes the contents of the footer on the detail section.

crazy.gif

I will not be beaten by this - this is such a simple idea in theory that there MUST be a way to get it working. I've attached what I've done so far...

(Edited as someone forgot to attach the file)
And then he attachs the wrong version of the file... oh is it hometime yet?? crazy.gif giveup.gif
Ad

Edited by: adaytay on Tue Oct 26 9:16:35 EDT 2004.
Edited by: adaytay on Tue Oct 26 9:22:51 EDT 2004.
adaytay
Whoops. Wrong attachment. Try this one...
khaos
Here is what I thought Glen
adaytay
Ah.... Could you post it in 2000 format please?
d
khaos
Attached has 97 and 2000 versions added.

Ken
adaytay
Thanks frown.gif Similar kind of thing to what I'm working but you've done a slight different approach - cool!
I'm still trying to get mine to work. Glenn, thanks for keeping me busy this afternoon laugh.gif
Ad
argeedblu
Ken,
hat's exactly what I was looking for, I think. I will experiment a bit with it today and tomorrow to make sure it's covering all the bases.
Thanks for a great solution.
Glenn
argeedblu
Ad,
I'm always happy to keep other people busy. frown.gif Ken's approach looks like it will do the trick but I'd also like to see what you come up with. I've been struggling for a couple of weeks just to figure out how to ask the question but I'm glad I did. This style of form is going to be another addition to my 'arsenal.'
Glenn
adaytay
Mine too Glenn that's why I'm determined to get it working! laugh.gif
till no closer however. There seems to be a glitch in Access (2000) that when you change the height of the form and refresh it it doesn't actually change the form at all :(
The kind of thing I'm after is you know when you add in Conditional Formatting conditions and you click "Add" and the form grows - that's what I want to acheive. Having no luck yet though :(
Ad
khaos
Glad to help. Let me know how it works out and what changes you have to make. My thoughts for this was to easily modify a switchboard type menu or a small pop-up menu. If you need more just let me know as my brain might be working enough to come up with a solution.
en
adaytay
Hi Ken,
here's one simple reason you got it and I didn't - your knowledge of Access far outweighs mine. I had no idea that InsideHeight was a valid argument, and that's exactly what I was looking for to do what I needed. Not making excuses, but I am still a bit of a n00b when it comes to this kind of thing!
I'm still trying to refine my solution a little more however I think you've pretty much covered it all. I'll not bother posting my end version as it'll be virtually identical to yours, only my "More" button won't be in the footer rather in the detail!
Thanks laugh.gif You stopped me going crazy today.
Ad
khaos
Glad to help. I found that one when I wanted to hide the scrollbars until a users viewable area was less than what showed on 800*600 with 1x height on the taskbar. Resolution didn't work because of the taskbar size.
How please continue your slide to craziness. What would life be like without the crazy people like me?
Garfieldm842
Khaos your a genius!!
ice one!
o! uarulez2.gif thanks.gif notworthy.gif
argeedblu
Ken,
Ybr />our suggestion is a gem. I have made some minor (heavy on the minor) changes to the form and developed forms with all four possible border styles. The concept works equally well regardless of the form's border style. I am attaching A97, A2K, and A2K versions although I have only tested the A2K2 version.
Once again you have reached into the vast depth of your knowlege and provided a teriffic solution. Many thanks.
Glenn
argeedblu
Ad,
Thanks for the effort you put in to helping me solve the problem. What you have described in your post sounds very similar to what I have been trying to achieve. I have applied Ken's suggestion to the problem and you can find the variation I came up with in the attachment here
Thanks very much.
Glenn
aoh
Guys,
I have no reason to use this, but I can't wait for a reason to start - very, very cool.
Well done to all of you.
Anne
khaos
Glad I was able to help you out.
argeedblu
Ken and all in this thread,
Here is the generic code I came up with based on ken's solution. Placing this code in a standard module makes it easier to work with for me. The constant rgTwipsPerInch will have to be publicly declared somewhere in your project
CODE
' public constant rgTwipsPerInch = 1440
Public Sub FormResize(frm As Object, InsideHeight As Double, InsideWidth As Double)
'********************************************************************************
*******
' Procedure : FormResize
' DateTime  : 2004-10-29 07:57
' Author    : Glenn Lloyd - Argee Services
' Purpose   : adjust the specified open form's inside dimensions in inches
' Returns   :
'********************************************************************************
*******
' This procedure is based on a solution posted by UtterAccess.Com member Khaos October 2004
'
' Useage
' FormResize can be called from any form event using the format
'
' FormResize me, <insideheight in inches>, <insidewidth in inches>
' with appropriate values substitued for the second and third arguments
'
'---------------------------------------------------------------------------------------
    On Error GoTo FormResize_Error
    frm.InsideHeight = InsideHeight * rgTwipsPerInch
    frm.InsideWidth = InsideWidth * rgTwipsPerInch
FormResize_Exit:
    'cleanup objects here
    On Error GoTo 0
    Exit Sub
FormResize_Error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure FormResize of Module basUtilities"
    Resume FormResize_Exit
End Sub
Once again, Ken thanks for leading me to this solution.
Glenn
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.