Update a 'Distinct' query

  • Thread starter Thread starter JM
  • Start date Start date
J

JM

My MSSQL linked table basically looks like this:

Jeff Blue Y
Jeff Blue Y
Jeff Blue Y
Jeff Blue Y
Fred Red N
Fred Red N
Fred Red N
Fred Red N
Fred Red N


I have a query 'select distinct * from table' and get this:

Jeff Blue Y
Fred Red N


I want to be able to change the Y/N field on a datasheet form, and have an
OnChange trigger of some sort update the appropriate records in the source
table, but I can't figure out the programming elements to make this happen.
I'm gettting: This field is not updateable.

Any clues?

Thanks! JM
 
You can't update data if you are pulling it in this manner. You have four
records that are identical. Pulling 'distinct' entries only shows you one
example of the data. It is not actually pulling a specific record. Access
would have no idea which of the four records to update if you tried to make
a change.

Rick B


My MSSQL linked table basically looks like this:

Jeff Blue Y
Jeff Blue Y
Jeff Blue Y
Jeff Blue Y
Fred Red N
Fred Red N
Fred Red N
Fred Red N
Fred Red N


I have a query 'select distinct * from table' and get this:

Jeff Blue Y
Fred Red N


I want to be able to change the Y/N field on a datasheet form, and have an
OnChange trigger of some sort update the appropriate records in the source
table, but I can't figure out the programming elements to make this happen.
I'm gettting: This field is not updateable.

Any clues?

Thanks! JM
 
Exactly my point, I'm not looking to update the table directly through the
table link, I was wondering if there was some sort of trigger that I could
write into some kind of OnChange event. I don't know the best practices or
best approaches using Access to write data front-ends. I have a lot of
learning to do.

Update table1 set Enabled = [EnabledValue] where FName = [FNameField] and
Color = [ColorField]
 
Back
Top