Results 1 to 5 of 5
  1. #1
    Waterdog's Avatar
    Waterdog is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Colorado
    Posts
    22

    New Customer Entry


    In my form, I've got fields for customer info. However, if I enter in a CustomerID that doesn't exist in the customer table then I get an error. In my old Access database that I had, I clicked on a button that opened up a new form. Type in the info and close the new customer form. Then the data would be in the customer table. What I'd like to do is simplify things. Is it possible to set it up to where I type in a customer ID and on losing focus it creates a new record in that customer table so when you continue typing in customer info it just adds the data instead of giving me an error? Either that or apply the same principal by means of clicking on a check box that could indicate the customer is new?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,948
    What you can do is use the combobox NotInList event and with some code, open the customer form, enter the new customer info, close the form, requery the combobox so the new record is available.

    https://www.accessforums.net/access/...ate-55139.html

    Is the CustomerID generated by autonumber or is it a custom unique ID assigned by you?
    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
    Waterdog's Avatar
    Waterdog is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Colorado
    Posts
    22
    The CustomerID is an existing number. Otherwise I'd just set that field to autonumber if I could. I was trying to consider different options. This form has a subform to it in which you can enter in various products that the customer is returning. Is it possible to code it in such a way to where I can just type in the customer info and when I change focus to the subform that it could run some code to add that customer to the database. Otherwise as it currently stands I can type a customers info in but as soon as I try to select the subform, that's when it gives me the error basically saying that customer isn't found in the customer table.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,948
    The method I referenced is the best I know.
    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.

  5. #5
    Waterdog's Avatar
    Waterdog is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Colorado
    Posts
    22
    Alrighty. Appreciate the input. Thanks!

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

Similar Threads

  1. Replies: 5
    Last Post: 03-09-2014, 07:16 PM
  2. Replies: 6
    Last Post: 12-11-2013, 09:27 PM
  3. Replies: 6
    Last Post: 09-27-2012, 08:27 AM
  4. Replies: 1
    Last Post: 12-24-2011, 08:48 AM
  5. Customer Entry/Find Duplicate/Similar names
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-27-2010, 09:20 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