2 Replies Latest reply on Sep 9, 2009 9:20 AM by philmodjunk

    Allow creation of new records through relationships without affecting exisiting records?

    zdecamp

      Title

      Allow creation of new records through relationships without affecting exisiting records?

      Post

      I am building a database in which I have a few different tables which I need to reference and input data from one central table. I have auto lookups on my main table for each related table using the automatically generated serial number for the respective records. Everything works well until I need to add a new record. Because the auto-enter serial is setup creating a new record works great, but If I forget to erase an existing serial number from the "serial's cell" prior to typing in another cell, instead of creating a new record it changes the current record related to that serial number.

       

      Is there a way to keep the existing lookup,  auto-fill and record creation infrastructure while not allowing it to change already existing records' information?

        • 1. Re: Allow creation of new records through relationships without affecting exisiting records?
          zdecamp
            

          Let me clarify to make sure I'm asking the right question.

           

          The serial number does not change, only the information pertaining to it. i.e. On "Customers" table I have:
          Customer_ID "auto-serial"
          Customer_Name
          Customer_Phone
          Customer_Address

          On my "Jobs" table I have
          Customer_ID "connected via relationship"
          Customers::Customer_Name
          Customers::Customer_Phone
          Customers::Customer_Address

          On the "Jobs" table, when I type in a serial number for a corresponding customer, it auto fills the rest of their information. I need to be able to create records in "Customers" from within the "Jobs" table, so I have it setup to allow for that in the relationship. The problem is if the "Customer_ID" has an existing number in it and I type in any other cell related to it, it will change the corresponding info related to that serial number.
          So I just looked up Customer_ID "1"

          Customer_ID "1"
          Customer_name "John Smith"
          Customer_Phone "(555) 999-5212"
          Customer_Address "1212 Cherry Blossom St"

          Now I want to add a new customer. If I don't delete the serial from the look-up cell before entering data into the other customer info cells it will change the data related to Customer_ID "1" instead of creating a new record.

          Did I explain that right? Everything seems to be working according to how it should be. I think I may just need a script or something along those lines to keep from losing existing records but still have the ability to both look-up info and create records from the "Jobs" table.










          • 2. Re: Allow creation of new records through relationships without affecting exisiting records?
            philmodjunk
              

            I suggest a button labeled "New customer" or such with a script along the following lines:

             

            Go To Layout [Customers (customers)]

            New Record/Request

            Set variable [$CustID ; Customers :: Customer_ID]

            Go To Layout [original layout]

            Set Field [Jobs :: Customer_ID ; $CustID]