Group Edit Help Please

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BurtonBach
    New Member
    • Oct 2006
    • 58

    #1

    Group Edit Help Please

    I'm still relatively new to Access and I want to make a form that allows the user to edit a grouped field all at once (if this is possible?)?

    For example, lets say there are 13 records in a table and in one column a the type is kept, either 1 or 2. For each type there is a price that changes. So I want the user to be able to select either 1 or 2 and edit the price and then on the one edit have all the records of that type change with the same one edit.

    I have no idea how to do this! Please advise or reference places to get the information.

    Thank you!
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by BurtonBach
    I'm still relatively new to Access and I want to make a form that allows the user to edit a grouped field all at once (if this is possible?)?

    For example, lets say there are 13 records in a table and in one column a the type is kept, either 1 or 2. For each type there is a price that changes. So I want the user to be able to select either 1 or 2 and edit the price and then on the one edit have all the records of that type change with the same one edit.

    I have no idea how to do this! Please advise or reference places to get the information.

    Thank you!
    What will simplify matters for you is an UPDATE Query(s). Assuming the [Type] Field is a Long Integer and the [Price] Field is of type Currency, the following Query will set the Price of all Records whose Type = 1 to $25.75. Hope this helps.
    Code:
    UPDATE tblTest SET tblTest.Price = 25.75 WHERE [tblTest].[Type]=1;

    Comment

    • MMcCarthy
      Recognized Expert MVP
      • Aug 2006
      • 14387

      #3
      Originally posted by BurtonBach
      I'm still relatively new to Access and I want to make a form that allows the user to edit a grouped field all at once (if this is possible?)?

      For example, lets say there are 13 records in a table and in one column a the type is kept, either 1 or 2. For each type there is a price that changes. So I want the user to be able to select either 1 or 2 and edit the price and then on the one edit have all the records of that type change with the same one edit.

      I have no idea how to do this! Please advise or reference places to get the information.

      Thank you!
      This is a matter of table structure.

      If you have a table for types called for instance tblTypes and then store the price per type in that table. Then if you change the value of the price you only have to change it in the one place. You will not need to store it elsewhere but only to create a relationship to the TypeID in the table that refernces it with a foreign key.

      If you're confused check out this tutorial

      Normalisation and Table structures


      Mary

      Comment

      • BurtonBach
        New Member
        • Oct 2006
        • 58

        #4
        I think in my effort to make the question simple I accidentally made it confusing. This database is going to work with fuel related transactions. Fuel prices change everyday. We have 2 fuel types. I need my admin to be able to edit the prices assigned to each of the transactions on a daily basis and I would like to do so through a form. But I don't want her to have to change each one individually. So I would like her to be able to input the price for all type 1's and then all type 2's.

        I hope this makes the question clearer. Maybe I should also mention that the raw data is coming from a flat file and that is why I have the type and the price on the same table.

        Thanks for any help!

        Comment

        • MMcCarthy
          Recognized Expert MVP
          • Aug 2006
          • 14387

          #5
          Originally posted by BurtonBach
          I think in my effort to make the question simple I accidentally made it confusing. This database is going to work with fuel related transactions. Fuel prices change everyday. We have 2 fuel types. I need my admin to be able to edit the prices assigned to each of the transactions on a daily basis and I would like to do so through a form. But I don't want her to have to change each one individually. So I would like her to be able to input the price for all type 1's and then all type 2's.

          I hope this makes the question clearer. Maybe I should also mention that the raw data is coming from a flat file and that is why I have the type and the price on the same table.

          Thanks for any help!
          Regardless of where the raw data is coming from you will need to separate it into individual tables. You should never use a flat file as the basis for a table. Design the appropriate tables and append the data in from the flat file.

          If you don't do this you will undoubtably have other problems. However, to answer the question you asked directly you would need to use an update query.

          Code:
          UPDATE TableName SET [Price] = [Forms]![FormName]![Price]
          WHERE [Type] =[Forms]![FormName]![Type]

          Comment

          • BurtonBach
            New Member
            • Oct 2006
            • 58

            #6
            The value of these networks/forums is huge. I wish that I could take those of you that answer all these questions out to lunch or something.

            That helped a great deal! Thank you.

            Comment

            • MMcCarthy
              Recognized Expert MVP
              • Aug 2006
              • 14387

              #7
              You're welcome!

              Glad to help.

              Comment

              Working...