Results 1 to 9 of 9
  1. #1
    enquiries is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Location
    Samoa
    Posts
    69

    Delete values in a multi-columned combo box

    Hi,

    I have a multi-columned combo box that has a primary key ID (hidden) and 2 other columns. In my subform this combo box will autopopulate the next two fields. e.g. select Bachelor Science, it will autopopulate the Qualification field as: Bachelor and the "Programe" field as: Science.......I can also type into the two fields a values that I cant find in the drop down list in the combo box and it will store it in the table and will show up in the drop down list when refreshed...........the problem is: "I cant delete a value that I want to delete from the combo box".

    Any suggestions/help will be greatly appreciated.
    Thanks,


    Enquiries

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    What is the rowsource of your combo?

    multi-columned combo box that has a primary key ID (hidden)
    Tables have primary keys. You might use that field in you combo's Rowsource, but it isn't considered the PK of the combo.

  3. #3
    enquiries is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Location
    Samoa
    Posts
    69
    Row Source is a query based on the table that selects the 3 fields - sorry I meant that it's a PK as in when you create a combo box it gives you the option to hide the PK field not the PK of the combo box.

  4. #4
    enquiries is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Location
    Samoa
    Posts
    69
    Row Source is a query based on the table that selects the 3 fields - sorry I meant that it's a PK as in when you create a combo box it gives you the option to hide the PK field not the PK of the combo box.

  5. #5
    enquiries is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Location
    Samoa
    Posts
    69
    I was thinking maybe 2 solutions along the lines of:
    1. an undo option where you can undo the action right after you type in the two fields
    2. a delete option where you can delete from the combo box

    Any help or reference to helpful material much appreciated

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    You would remove them from the table or the query. It's the rowsource that has the data, so remove the data you don't want, from the table or query.

  7. #7
    enquiries is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Location
    Samoa
    Posts
    69
    Thanks Orange, would it be possible with code to somehow remove it from the form as the tables will be hidden from the user editing them. If not then I might allow this one table to be edited as it is near impossible to think of a general list of all the qualifications and programmes possible - but I need it to be a in a drop down menu so that I can use that to select values when running a query......otherwise users might enter it in different formats and the search might not include everything. Thanks for your help

  8. #8
    trevor40's Avatar
    trevor40 is offline Advanced db Manager
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    402
    for your option 2 you could use a delete query with the criteria based on the combo box value, click your button to run the query then requery the combo box to update the list of values

  9. #9
    enquiries is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2013
    Location
    Samoa
    Posts
    69
    Thanks
    I've just added macro buttons undo and delete and changed the form's default view to form as I'm using a datasheet view (neater) and that works fine, I've also had to add a new button as compared to datasheet you can't just add a new record - the user can still select a pretend value when backspacing and then select undo which is much neater - so it's all working great now ^_^

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-27-2014, 03:43 PM
  2. Multi Selection Box User submitted Values
    By LordPanzer in forum Access
    Replies: 3
    Last Post: 09-30-2013, 01:32 PM
  3. Force New Line in columned Report
    By gg80 in forum Reports
    Replies: 7
    Last Post: 09-20-2012, 07:00 PM
  4. Multi select list box and DELETE query
    By thart21 in forum Programming
    Replies: 1
    Last Post: 01-08-2012, 08:47 PM
  5. Delete cells <= 2 letter values
    By melting in forum Access
    Replies: 5
    Last Post: 05-14-2011, 07:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums