Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Combo Box Problems

Discussion in 'Information Technology' started by Confused_Dave, Jul 28, 2006.

  1. Confused_Dave

    Confused_Dave
    Expand Collapse
    Guest

    Hi,

    I'm looking for a little advice. I'm creating database where users can log
    equipment faults in our IT suites. The usrs will access the database via a
    web access page. On the page i've created a combo box which holds a list of
    room numbers. below that in i have a list of computer names. I would like to
    have the list of computers relavant to the room number. So if a user wants to
    log a fault in "IT1" they can select it in the combo box and the computer
    list will only show the computers in that room.

    Phew! Can anyone give any pointers how i can achieve this.

    Thank You in Advance

    Dave
     
  2. Loading...


  3. Sprinks

    Sprinks
    Expand Collapse
    Guest

    Dave,

    This is done by changing the 2nd combo box' RowSource property in the
    AfterUpdate event of the first. Search for forum for "Cascading Combo
    Boxes". Here is another helpful link:

    http://www.fontstuff.com/access/acctut10.htm

    Note: If you're trying to do this on a continuous form, it's more
    complicated because a combo box can have only one value for its RowSource
    property, which is the same for all records. If entered records have a value
    that no longer is in the RowSource list, Access cannot display the value.
    The data "disappears"! even though the value in the underlying table remains
    unchanged.

    The workaround is to use a textbox for the 2nd value, and popup a dialog
    form with a single combo box in its OnGotFocus event. After the selection is
    made, you can write the selected *value* to a hidden textbox bound to the
    corresponding field, and display more meaningful text if necessary by either
    writing it to a visible textbox or using DLookup().

    ' OnGotFocus event of textbox on main form

    ' Open dialog box with single combo box
    DoCmd.OpenForm _
    FormName:="YourPopUpForm", _
    View:=acNormal, _
    WindowMode:=acDialog

    ' Set focus to the next control
    Me![NextControlOnMainForm].SetFocus


    ' AfterUpdate event of popup form
    Forms![Your1stForm]![YourBoundHiddenTbox] = Me![YourPopupCBox]
    Forms![Your1stForm]![YourUnboundVisibleTbox] = Me![YourPopupCbox].Column(1)
    DoCmd.Close

    Hope that helps.
    Sprinks

    "Confused_Dave" wrote:

    > Hi,
    >
    > I'm looking for a little advice. I'm creating database where users can log
    > equipment faults in our IT suites. The usrs will access the database via a
    > web access page. On the page i've created a combo box which holds a list of
    > room numbers. below that in i have a list of computer names. I would like to
    > have the list of computers relavant to the room number. So if a user wants to
    > log a fault in "IT1" they can select it in the combo box and the computer
    > list will only show the computers in that room.
    >
    > Phew! Can anyone give any pointers how i can achieve this.
    >
    > Thank You in Advance
    >
    > Dave
     
  4. Confused_Dave

    Confused_Dave
    Expand Collapse
    Guest

    That's done it.

    Thank You Very Much

    I'll have to change my username now.
     

Share This Page