Results 1 to 11 of 11

Thread: Drop down menus

  1. #1
    Join Date
    Dec 2005
    Location
    Somewhere on the 3rd Rock
    Posts
    93

    Question Unanswered: Drop down menus

    I have seen a couple of databases that have a dropdown menu that appears as only one box on a form, until you select data in that box, then another box appears below that one. and so forth, down to a set number of boxes / drop down menus.

    I have never attempted to use this but would like to learn how to make it work.

    anyone point me in the right direction.

    thanks
    Will Dove
    working hard is better then hardly working ...

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Not hard; the other controls are set to invisible to start. In the after update event of the first, the second is made visible, and perhaps it's source is set/requeried if it's dependent on the first. And so on.
    Paul

  3. #3
    Join Date
    Aug 2006
    Location
    Lincoln, UK
    Posts
    24
    It sounds so easy when you say it like that, but, I suspect that we've only heard half the problem.

    I suspect that what saileast wants to do is: -

    If you select A in the first box then you see optins A1, A2, A3
    If you select B in the first box then you see options B1, B2, B3

    and so on.

    It be grateful if some one could give us a quick example of how to do this, I've been puzzling over it for days.

    Regards
    Das

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I anticipated that, which is why I added "and perhaps it's source is set/requeried if it's dependent on the first". That's a simple matter of cascading combo boxes, which has been addressed here many times.
    Paul

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Combo box

    Another "trick" which I'm not sure if it applies here but sometimes you can have multiple columns in a combobox where other columns have 0 set as the length (i.e. there are 3 columns where the length of column 1 = 0 (hidden), column 2 = 2 (what get displays), and column 3 = 0 (hidden) 0;2;0).

    When a value is selected in the 1st combobox (say it's called: mycombo), then another combobox (or listbox, etc) might be set to equal the value of the 3rd column (i.e. XXX = me.mycombo.column(2)). I say (2) because you start with 0 then 1, then 2, etc. when dealing with combo/list boxes so the 3rd column is really 2 (confusing? yeah probably so but I thought I'd throw that out there anyway).
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Dec 2005
    Location
    Somewhere on the 3rd Rock
    Posts
    93
    No nothing to tricky with this one

    all the textboxes/ drop down menus will pull data from the same table. I just don't need the form to show all boxes unless the previous is entered.

    The main thing is I don't want the user to enter data in field 3 and leaving blocks 1 and 2 empty. and so on....
    Will Dove
    working hard is better then hardly working ...

  7. #7
    Join Date
    Dec 2005
    Location
    Somewhere on the 3rd Rock
    Posts
    93
    How would I do this?

    Quote Originally Posted by pbaldy
    Not hard; the other controls are set to invisible to start. In the after update event of the first, the second is made visible, and perhaps it's source is set/requeried if it's dependent on the first. And so on.
    Will Dove
    working hard is better then hardly working ...

  8. #8
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Exactly where are you stuck? I've told you the event to use (after update) and the property to set (visible).
    Paul

  9. #9
    Join Date
    Dec 2005
    Location
    Somewhere on the 3rd Rock
    Posts
    93
    The code to put in the after update event. I know how to set the visable, but don't know what code to use.

    Quote Originally Posted by pbaldy
    Exactly where are you stuck? I've told you the event to use (after update) and the property to set (visible).
    Will Dove
    working hard is better then hardly working ...

  10. #10
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    attached shows two simple ways.
    frm1 uses queries 'built in' to the combo
    frm2 uses queries generated in code.

    i also use subform-switching to accomplish a similar effect. the subform approach provides much more flexibility about what other data can be displayed (and edited) at each 'nesting level'.
    simple illustration here.

    izy


    LATER - forced to replace the .MDB by 'external considerations': no material change
    Attached Files Attached Files
    Last edited by izyrider; 09-03-06 at 11:30.
    currently using SS 2008R2

  11. #11
    Join Date
    Dec 2005
    Location
    Somewhere on the 3rd Rock
    Posts
    93
    Thank you I am now headed in the right direction
    Will Dove
    working hard is better then hardly working ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •