Results 1 to 7 of 7
  1. #1
    AlliCrader is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2017
    Posts
    12

    Adding to a lookup table from form

    Click image for larger version. 
<br /><script async src=
    Name: addtolookup.PNG  Views: 13  Size: 10.6 KB  ID: 29799" class="thumbnail" style="float:CONFIG" />


    What I am trying to do is create a box that will pop up and allow you to enter a new PART ID, Description, Price & Suppler into the lookup table. The subform on here is created from a query that uses the lookup table which is Parts and the order details table for QTY. How would I code in something so that if the PART ID does not exist in the Parts table, I can add it with the above mentioned fields?

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Few ways to do it but maybe try in the properties on the combo box, make Limit to List "No", List Items Edit Form (Select the popup form used to add/edit the list values).

    You could also do this manually. Sometimes I put a small button after the combobox with an astrick or EDIT in small letters or do this in doubleClick event to open the popup form to edit the list, once they enter values and close that form(model mode), I requery the combobox so the new value is available, now they select the new value from list. But that first option might work just as well also.

  3. #3
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Or set the Limit To List to Yes and use the NotInList event to run a query to add a new record to the lookup table.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The PartID combobox should show the description, not the ID. The user should not be able to change the description or the PartID, only add a new one.

  5. #5
    AlliCrader is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2017
    Posts
    12
    I cannot get this to work.

  6. #6
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    What way are you trying to do it and what does not work, give more details and error messages.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Bing: combobox NotInList event
    Review https://msdn.microsoft.com/en-us/vba...t-event-access
    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.

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

Similar Threads

  1. Replies: 4
    Last Post: 07-26-2016, 02:39 AM
  2. Replies: 3
    Last Post: 12-01-2015, 12:20 PM
  3. Adding Lookup Columns to a Table
    By Lou_Reed in forum Access
    Replies: 1
    Last Post: 09-21-2015, 12:28 PM
  4. Replies: 3
    Last Post: 05-08-2015, 11:08 AM
  5. Replies: 1
    Last Post: 09-09-2014, 02:01 PM

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
  •  
Other Forums: Microsoft Office Forums