This topic is locked

How Update Unique Group of Records based on value of field on Record

5/3/2008 3:20:57 PM
ASPRunnerPro General questions
P
paulyap2k author

I would like to update a group of specific records based the values of specific field within these records. Example of what I' trying to accomplish.
The data has 3 fields. CompanyName, BusinessType, Status
After I check perform check on status box with value of either [yes/no] on a single record with a specific business type, I would like all other records with the same BusinessType to be updated with the same status value.
I have tried creating a view table from the original table, and group the business type to view only unique business type on the list page, but I am not able to update the yes/no status to all records based on the listing of unique BusinessType.
Hope my explaination is clear. I am a non programmer.

P
paulyap2k author 5/4/2008

To make better eleboration on what i am trying to achieve. I have just purchase ASPrunnerpro5.2 recently, trying to build my first projects. Would appreciate any help provided
--------------------------

I would like to update at one go multiple records automatically after I have updated a single record.
The record has 3 fields. CompanyName, BusinessType, Status.
After I edit status from no to yes value, I would like to update automatically for the the rest of the record (that has the same business type) status to the same value.
Original with one table in accessm, and I have created a view table from the original table, and under the view table i have group the business type to view only unique business type on the list page, when i do an update to the unique business type, I am not able to update the yes/no status to the rest of records with the same BusinessType. Believe I am not doing this correctly.
Again.. i would really appreciate any help provided as i have been spending lots of time trying to figure out the way to accomplish this.
[/quote]

J
Jane 5/5/2008

Hi,
use After record updated event on the Events tab for this purpose.

Here is a sample:

strSQLUpdate = "UPDATE TableName set Status = " & dict("Status") & " where CompanyName='" & dict("CompanyName") & "'"

dbConnection.Execute strSQLUpdate