Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2008

    Unanswered: Multiple Comboboxs, with odd variable thrown in

    I am using Access 2003.

    I have two variables that are set within a database table. These variables indicate the number of floors below grade (BG) and the number of floors above ground (AG). These variable are not interdependent in any way. BG has three options 0, 1, 2 levels below grade. AG has five options and does not include the roof.

    I would like a resulting combobox that will list the appropriate level names for the various conditions supplied by the variables AG and BG. The resulting stored values in the box will be constant for all shown except the roof, which is always the highest number shown. See attached PDF to get a clearer picture. I have tried to wrap my mind around the logics involved in setting this up but have failed miserably.

    Be advised this is NOT a school project. I am setting up an automated file naming system for architectural project files to have some consistancy.
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    what you could do is store int he row NoFloors above & Below
    when you build you select floor combo pull in the values from both recordsets

    dim rsfloor as recordset
    set rsfloor = openrecordset("select <mycolumnlist> from <mybuildigntable> where building ID = blah", <whatever the correct parameter is for a recordset>)
    Dim FloorCoutner as integer
    Dim strRowsource as string
    'lets put in the floors above ground first
    if <nofloorsbaovegroundretrievedfromrecordset> >0 then 'do we have any floors above ground?
    for Floorcounter = <nofloorsbaovegroundretrievedfromrecordset> to 1
    strrowsource = strrowsource & FloorCounter & ";"
    next floorcounter
    'lets put in the floors below ground next
    if <nofloorsbelowgroundretrievedfromrecordset> >0 then 'do we have any floors below ground?
    for Floorcounter = <nofloorsbelowgroundretrievedfromrecordset> to 1
    strrowsource = strrowsource & "-" & FloorCounter & ";"
    next floorcounter

    you coudl change the way the loops are handled so that you got a list starting at the hoghest floor, and ending at the lowest, say you had 9 fllors above, & 3 below: 9;8;7;6;5;4;3;2;1;-1;-2;-3;
    you could add text if you wished

Posting Permissions

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