Share via

List items edit form

Anonymous
2012-04-30T04:28:11+00:00

I have a combo box on a form.  If the text entered is not on the list it is set to open a form to edit the list. All well and good but a bit cumbersome to have to re-enter the text in the list items edit form. Any idea on a solution ?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-04-30T17:42:58+00:00

Take a look at the file NotInList.zip in my public databases folder at:

https://skydrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

You might have to copy the text of the link into your browser's address bar (not the link location).  For some reason it doesn't always seem to work as a hyperlink.

This file demonstrates the use of the NotInlist event procedure of a combo box in various contexts, some which open a form to enter additional data to the new record in the referenced table, some which transparently insert a new row in to the referenced table where no additional data is required.

Was this answer helpful?

0 comments No comments

15 additional answers

Sort by: Most helpful
  1. Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
    2012-04-30T13:38:49+00:00

    The answer would depend on the finer points of your implementation, but suffice to say if you do it correctly it does not need to be entered again, Check the sample code in the NotInList event in the help file.

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,830 Reputation points Volunteer Moderator
    2012-04-30T12:15:34+00:00

    This depends on whether the info you are adding to the RowSource of the combo is just the one piece of data or whether there is other info to be added.

    For example, lets say you have a lookup table of product categories. The table looks like:

    tluProductCategories

    ProductCategoryID (PK Autonumber)

    ProductCategory

    So the user types in the category. You can then use the NotInList event to add that new category to the table after prompting the user. You can find examples of code for the NotInList event in VBA help.

    I still use the NotInList event when I want to add more info as well. The difference is I capture the Autonumber PK after inserting, and then open the form filtered for the newly added record.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-04-30T07:34:18+00:00

    Take a look at this page from Allen Browne's site:

    http://allenbrowne.com/ser-27.html

    He uses a query to add an item to the table rather than a recordset, so that is most likely the best way but I don't know why.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2012-04-30T06:14:59+00:00

    Instead of opening a form, why not use a msgbox to check with the user that they want to add to the list.  If a new entry is required then this could be made with a recordset.

    Was this answer helpful?

    0 comments No comments