Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Boxes (Acess2K/XP)

    Attached is my problem:

    Main form is frm_Client_Info; sub form is frm_Client_Results (tab client services). When I enter a test type on client services the test_results and test_Recommendtions are updated depending on my test type choice. The problem occurs when I enter a new type. The previous results and recommendations no longer appear on the form, but are in the table. Guidance is needed. Thanks in advance as always.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Boxes (Acess2K/XP)

    In a datasheet or continuous form, there is actually only one set of controls. When you requery the combo boxes, their row source changes in all displayed records, not just in the current record. Since the value of the Test_Results field (for example) may not be present in the row source any more for some records, this value will no longer be displayed.

    There is no workaround for this in a datasheet form. In a continuous form, you can place a text box bound to the same field on top of the combo box, such that it covers the entire combo box except for the dropdown arrow. When the combo box doesn't have the focus, the text box will display the current field value. When the user clicks the dropdown arrow, the dropdown list will be displayed.
    With a bit of work, you can make a continuous form look almost like a datasheet form (if you so wish)

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Boxes (Acess2K/XP)

    Thanks Hans for the quick response. Guess I have some additional work to do.

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Combo Boxes (Acess2K/XP)

    Do both the text box and the combo have the same control source?

    Have you got a sample database showing this?

    The database above is not accesible.

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Combo Boxes (Acess2K/XP)

    Here is an example Patt.

    Resources are supplied in response to requests, but some resources are no longer current, so we don't want so be able to choose them anymore.

    There are two versions of the subform. One shows blanks were a now non-current resource has been supplied.
    The second subform uses a text box to show the name of the Resource.

    This also has a trick of requerying the combo in the on-current event, so if you click the drop down, the current resource is actually there.
    Attached Files Attached Files
    Regards
    John



  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Combo Boxes (Acess2K/XP)

    I know the OnCurrent event must requery the combo box so the name is put into the text box which is in front of the combo box.

    Thanks for the example.

  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Combo Boxes (Acess2K/XP)

    The requery in the oncurrent event is not needed for the text box to show the names.
    That works without the requery.

    The row source of the combo has an "or" clause, so that if you click on the drop down for a "old record" which is no longer current, you still see the name of what had previously been selected.
    This is a bit of a frill, and requires the requery to work.

    John
    Regards
    John



Posting Permissions

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