Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2008
    Posts
    3

    Question Unanswered: Opening a record by entering primary key

    I am working on an Access DB for our receiving process here in the IT department. We order new equipment and each piece of equipment has a PO attached to it.

    Everything seemed to be okay, but now, on the PO # field I would like to enter the PO # and all of the information about that PO come up. Instead, I enter a PO #, hit enter, and it just creates a new record, and then gives me an error about having identical primary keys.

    So, how do I make it so that I type in a PO, press enter, and all of the information previously entered about that PO comes up?

    Thanks in advance for any help you can give!

  2. #2
    Join Date
    Jan 2006
    Location
    New England
    Posts
    12
    Sounds like you are using a form that is set-up for data entry. The primary key error probably shows up because the table is set to store each PO# as unique and you are trying to reenter that number.
    Is there a query or form setup that allows to search/select info for each PO?

  3. #3
    Join Date
    Mar 2005
    Location
    Phoenix AZ
    Posts
    56
    To further expand on what ottovon said, most purchase orders (at least the ones I deal with) are for multiple pieces of equipment. Therefore, using PO# as a unique record, at least from what I am reading won't work.

    Base the record source for your form on a query with PO# as the parameter so you can bring up all of the PO details and then edit what you need to. Without knowing the structure of your tables though, make sure your recordset is updatable prior to doing this. Multi-table queries are often not updateable.

  4. #4
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    If you open the form in design mode, right-click on the small box in the top LH corner and select Properties, you will see a list of properties such as Allow Additions, Allow Updates and so forth. Below these is a property called Data Entry. If set to Yes, it causes every edit to be treated as a new record. It should be set to No, if you do not want this particular functionality. All the others should be set to Yes for the usual flexible behaviour.

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by juice13610
    I would like to enter the PO # and all of the information about that PO come up.

    So, how do I make it so that I type in a PO, press enter, and all of the information previously entered about that PO comes up?


    Hi juice,

    Getting to the beginning of it all, HOW is the PO number created in the first place? It sounds like you are trying to Find a PO number that already exists to add more data to it. So first, do you already have the PO number? If you do, try having it in something like a ComboBox and then use that to select the PO number of your choosing. How is the PO number created in the beginning? Is it Index set to Yes(No Duplicates)

    Bud

  6. #6
    Join Date
    Sep 2008
    Posts
    3
    Thanks everyone for your help.

    ottovan, I wasn't thinking. I added a button in design form and found a very simple way to add a search function.

    Jim Wright, I will try doing that and report back, thank you.

    Bud, the PO is entered manually. We will be creating probably up to 10 POs a day, so I don't think I'd want to make somebody scroll through and choose.

  7. #7
    Join Date
    Sep 2008
    Posts
    3
    Quote Originally Posted by Jim Wright
    If you open the form in design mode, right-click on the small box in the top LH corner and select Properties, you will see a list of properties such as Allow Additions, Allow Updates and so forth. Below these is a property called Data Entry. If set to Yes, it causes every edit to be treated as a new record. It should be set to No, if you do not want this particular functionality. All the others should be set to Yes for the usual flexible behaviour.

    I guess I'm not sure which small box you speak of. Also, when creating a new record, I would like it to create a new record when the number is not recognized. I just want it so that when a PO that has already been used is entered, it brings up the information on the record that has arleady been entered..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •