Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2011
    Posts
    56

    Unanswered: Can a combo box be populated with additional "typed in" choices

    Can alternative selections that are typed into a combo box be add to the list of choices that are already in the combo box for future use? I think I am almost looking for a self updating combo box.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you can allow users to enter something other than the already included items.. thats one of the differences between a combo box and a list box: look for the 'limit to list' property. however that addition is only for the duration of that forms 'life', if you close the form then re open it it will revert back to the original list.

    to retain such information you really need to use a persistent datastore, whether thats a table or a flat file doesn't really matter, although a table will usually be a smarter call.

    if you use a table (and that would be what I'd want to do) then you may be better off using another form to populate that table and a button on the form containing the combo boxe that refreshes the underlying recordset of nay list or comb boxes as changes made to their tables will not be refreshed automatically
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Aug 2011
    Posts
    56
    Ok, I am making the combo box list from a table. I've seen that the selections in a combo box can be updated if the table that feeds the combo box is updated. I guess I was kind of looking for a way to create a loop. So when you go to the combo box in table 1, it shows you the selections stored in table 2, but the one you want isn't listed so you type the value in. Now that the value has been entered in table 1, I want to add it to table 2 automatically.

    As you can tell I am new to access, so my explainations make lack details that are important.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    combo box in table 1, unless you are using the seriously crappy 'lookup wizard' there is no such beast as a combo box in a table.

    you can do what you want if you place some code behind the combo box. offhand I don't know the event you'd want to use, precisely because thats not the way I'd normally expect to set up such data. I'd expect to have another form (controlled by appropriate permissions which restrict access to change 'masterfile' data) to make that change. even if you don't use such a permissions model I'd still want to use a separate form to control validation and ensure data integrity.
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Aug 2011
    Posts
    56
    guilty as charged. sometimes i forget to do everything in forms. i was trying to keep forms simple for everyone to use. i will give the seperate form a try.

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    You really have to do this in a Form! And in point of fact, end-users should never have direct access to Tables but rather deal with Tables via Forms or Queries!

    You can do this in pre-2007 versions using the Not In List event.

    With versions 2007/2010 Access added an automatic way of doing this directly from the Form the Combobox resides on.

    Allen Browne explains both methods in depth here:

    Microsoft Access tips: Adding items to a combo/list box

    Linq ;0)>
    Last edited by Missinglinq; 09-24-11 at 01:02.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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