Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012

    Unanswered: Adding item to combobox on the fly but not permanently?

    I have a combobox for a medical database tracking patients. I want the combobox on the form to have possible treatments to select and add to that patients profile. I will create the list of treatments for the combobox, but every once in a while we will have other treatments that won't be in the list. Now, I know how to add the item to the list when typed into the box, which then adds it to the table, but My problem is we may not always want these rare treatments included in the options as they will just clutter up the box and are only selected once in a blue moon.

    Is there a way to add a different treatment but not permanently add it to the list? Right now I plan on manually typing the list options, but I could connect it to it's own table if need be.

  2. #2
    Join Date
    Jan 2002
    Bay Area
    I don't know if adding a separate form with a combo box is the best solution to avoid cluttering your main combo list,
    but you might consider it if nothing else comes up.

    Display the list of rarely chosen items in a #2 combo list displayed in a modal form when needed. When you pick a rare treatment,
    or type in something not in the list, two buttons labeled, for example, [OK] and [Cancel], handle whether or not an item is to be
    added to the #1 combo. If [OK] is clicked and the combo #2 value is not blank, add the value to combo #1, and close the new form
    at the end of the [OK] code. If [Cancel] is clicked, just close the new form.

    You could also include notes or instructions in a label on this added form, if this is appropriate.

    You can make this appear a little more uncluttered by setting the dimensions (height & width) of the new form identical to the dimensions
    of the main form, which in effect makes the main form invisible while the new form is open.

    Good luck.

  3. #3
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    put the treatments into another table, use that table as the source for the combo box
    add a treatment categorisation to that table
    eg table Treatements

    ID Cat   Decscription
    01 Std   Common Cold
    02 Std   Asthma
    03 Wierd Munchousens by Proxy
    91 Scary Ebola
    then pull all the standard ones every time.
    have a button, or more than one or a set of checkboxes to say what treatments you want to see in the combo

    if you have loits and lots of treatments then findign the correct treatemtn in a combo box could be tricky so you might want to consioder using a self referencing 'parent treatment' to allow users to drill down will they find the correct treatement.

    and alternative control could be to use a tree control to make it easier to display the data
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    May 2012
    I love your idea and I think I could do it but what kind of SQL Statement would I need to make it only add the std items from the table? And how would I get the items to switch on the click of the button?

    Also, for learning purposes, what is a tree control and a parent treatment? I am new to this and am trying to learn as much as possible!

Tags for this Thread

Posting Permissions

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