Results 1 to 2 of 2
  1. #1
    NER is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    1

    Maintaining unique CustomerID with multiple purchases

    Hello,

    I am trying to make a basic database system to track orders and contacts and the like for my small business. I have created a series of databases that look pretty standard, something like this example:


    I want to create a form that I will open and complete every time I process an order. I want to fill out both the customer info and the order details at one time.

    Assuming that the "CustomerID" in the "Customers" table is set to Autonumber in order to create a unique ID, how do I keep from creating multiple new "customers" every time I enter a new order regardless of whether or not that customer already has an ID number from a prior order?

    It seems that I would need to make some sort of Macro that would say something like, if the "CompanyName" entered is already listed in the 'Customer' table, use the existing CustomerID, if it is not listed in the Customer table create a new CustomerID.



    I'm obviously new to databases but am slowly stumbling along. Can someone help point me in the right direction. Should I be looking into Macros, and if so should the macro be built into the form or the database? Is there another better solution to what seems like it would be a pretty common problem?


    Please move post if this should be in the Macros Forum.

    -Thanks

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Perhaps this earlier post will help: https://www.accessforums.net/databas...orm-22220.html
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Replies: 1
    Last Post: 02-18-2015, 07:09 AM
  2. Replies: 8
    Last Post: 02-03-2014, 07:01 PM
  3. Comparing purchases across groups over time
    By TheFuelGuy in forum Access
    Replies: 1
    Last Post: 07-29-2013, 10:46 AM
  4. If IsNull CustomerID Then Disable Subform
    By burrina in forum Forms
    Replies: 7
    Last Post: 12-11-2012, 06:45 PM
  5. Replies: 1
    Last Post: 12-04-2012, 07:08 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