Results 1 to 5 of 5
  1. #1
    tpann is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Location
    Seattle, WA
    Posts
    3

    Drop-down field that updates table if a new value is entered

    Hello,

    I'm new to this forum, thank you for having me. Also, I'm a novice user and definitely not very well versed in the concepts of relational databases. This subject may be covered somewhere but I don't really know what key words to use to search for it.

    My question is this: Say I have a database to track my checking account. In addition to the table that tracks transactions, I have a table for payees. In my main form the payee field is a combo box that pulls from the payees table. (actually a query but you get the gist)

    I want to select payees from my droop-down and of course auto-fill if I type. But I also want to be able to enter a payee that is not in my payee table. AND, if I do that, I want the form to update my payee table with the payee I typed.

    How do I do that?

    Thank you,
    Tim

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    That's what combobox NotInList event is for. This is a very common topic. Search web or forum and will see many discussions.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you need to use the combo notinlist event typically to update your payees table with the new value, or more likely open the payees form so the user can enter the payee details because you presumably have more than one field to complete - id, name, perhaps full name, type of payment, payee account details if paying electronically etc.

    If your payee list is just a list of names and not intended for control/spelling purposes (like a list of US states for example), you can just use a SELECT DISTINCT query for the combo rowsource based on the table and field the combo refers to and do away with the payee table

    e.g.

    Code:
    SELECT DISTINCT Payee
    FROM tblTransactions
    ORDER BY Payee

  4. #4
    tpann is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Location
    Seattle, WA
    Posts
    3
    Thank you! I'll go look more for notinlist.

  5. #5
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209
    I think this will be a good starting point:

    https://www.msaccesstips.com/2013/12...n-list-is.html

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

Similar Threads

  1. Replies: 2
    Last Post: 07-20-2018, 06:20 AM
  2. Replies: 2
    Last Post: 09-05-2017, 10:36 AM
  3. Replies: 14
    Last Post: 03-15-2017, 08:33 PM
  4. Replies: 1
    Last Post: 09-15-2012, 08:22 AM
  5. Replies: 20
    Last Post: 09-04-2012, 10:56 AM

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