Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2002
    Posts
    20

    Question Unanswered: Subordinate combo boxes

    I am trying to create a database to log system events like upgrades, patches, error mesages, and lock ups.

    Is there any way I can make a combo box with a list dependent on a value i select for another combo box on the same form?

    example 1:
    combo box1 [User]
    combo box2 [Error Msg | Upgrade | Lock up]

    example 2:
    combo box1 [System]
    combo box2 [Upgrade | Patch]

    The problem I am having is since values are not instantly written to the tabel when I select the value for the first combo box, the second box has nothing populated. Is there any way to do this without putting the 2 boxes on different forms?

  2. #2
    Join Date
    May 2002
    Location
    Atlanta, GA
    Posts
    117
    Hey nrage,

    You sure can. Just create a query in your first combo box that pulls your initial data. Then reference your second combo boxes query off the first combo box.

    combobox1:

    SELECT Name FROM NameTable;

    combobox2:

    SELECT Address FROM NameTable WHERE Name = Forms!FormName!ComboBox1;

    Then with VB under the On Click Event of the second combo box place a command like:

    Private Sub ComboBox2()
    DoCmd.Requery "ComboBox2"
    End Sub

    You will have to make the appropriate changes to suit your application but let me know if you need help.

    Kal

  3. #3
    Join Date
    Jul 2002
    Posts
    20

    Thumbs up

    thanx kal. Worked like a charm!

  4. #4
    Join Date
    Jul 2002
    Posts
    20

    Question

    I have another question about the same problem.

    Now I want to do a similar thing with check boxes. But check boxes do not have the Row Source feature a Drop Down has.

    I want to make a Notification feature to my errors db.
    There is a Resolved Check Box. It is defaulted to False
    There is a Notification Check Box. It is resolved to True

    when Resolved is set to True, I need Notification to be set to False.

    Help please.
    I think i need to do this:
    IIf([Forms]![Incident_Master]![Resolved]=True,[Forms]![Incident_Master]![Notification]=False,[Forms]![Incident_Master]![Notification]=True)

    but i dont know where. help.

  5. #5
    Join Date
    May 2002
    Location
    Atlanta, GA
    Posts
    117
    Hey rage,

    Are you still working on a form with Check Box fields?

    Kal

  6. #6
    Join Date
    Jul 2002
    Posts
    20
    Yeah, do you need a snapshot of the form?
    Its very simple what I am trying to accomplish but I am unsure where i put the behaviour.

    On my Master form (I see my first typo now, but that is only in the previous post) There are the 2 check boxes Notification and Resolved. I just need the value of Notification to be dependent on the Value of resolved (easy) when the user clicks on resolved (i am clueless).

    I got the combo boxes to work. Oh btw, I added a requery to the Activate of the form for the combo box, for it was giving me some weird behaviour when I scrooled thru the records.

    thanx.

Posting Permissions

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