Edit Contents of Data Cell of Data Row

Hi

I have a table which when a user starts editing contents in the second data cell of a row auto fills the contents of that data cell. It works fine. However, what I am now trying to do is when the user starts editing one cell, the app auto fills that cell and also the next one. In this case, the user is entering a magazine code, the next cell would be the magazine name.

Here’s the process -

I set a variable for the table and the row selected:

set thisTable to table view “fileInfo” of scroll view “tableScroll” of tab view item “tab1” of tab view “tabby” of window “addWin”
set thisRow to selected row of thisTable as string

I then do a check to make sure this is a row that can be edited. If it is, I determine what is being edited by which row number it is. I then take the results of the first two keystrokes (as long as they are letters/numbers/symbols but no events (shift, return, etc.) and use that string to make a MySQL query on the proper table in my database. If there is a result, it takes that result and autofills the cell, if not, it pops up a window saying so and ask if you want to add a new entry to the db table, if more than one result is returned I open another window that list the results and let’s you select which one you want and write that back to the cell.

With the magazine codes I use that db query to also return the name. (They are in the same table). Where I get stumped is how to fill in the cell in the next row (where the mag name would go in my table).

I have this code with no help:

set content of data cell 2 of data row ((thisRow as number) + 1) of table view “fileInfo” of scroll view “tableScroll” of tab view item “tab1” of tab view “tabby” of window “addWin” to pubName

Here’s my error message:

Can’t make «class datC» 2 of «class datR» 12 of «class tabW» "fileInfo" of «class scrV» "tableScroll" of «class taVI» "tab1" of «class tabV» "tabby" of window "addWin" into type reference."

Any help would be appreciated.

Thanks

Duh, I figured it out, was forgetting to reference the data source -

set content of data cell 2 of data row ((thisRow as number) + 1) of data source 1 of table view “fileInfo” of scroll view “tableScroll” of tab view item “tab1” of tab view “tabby” of window “addWin” to pubName