Try it this way:
Set Variable [$ID ; Inventory::K_ID_Record]
Go To Layout [Photos]
Set Field [Photos::Item_Key ; $ID]
BTW, Photos isn't a "database" it's a table. And you definitely need to use Go To Layout to change the "current table occurrence" during script execution. Each layout refers to a table occurrence in "show records from" in layout Setup... Each table occurrence is a "box" in Manage | Database |Relationships. Each such table occurrence has it's own, current record, found set and sort order for each FileMaker window currently open.
For more on table occurrences, you can check out this tutorial on the concept:
Thanks for the quick reply. Sorry for using the wrong term. I've been doing MySQL and other SQL db development for years so I know the difference between a database and a table, but I started db development on an transactional database engine which really messed up my terminology and as you can see I still use the wrong terminology from time to time. sorry again for confusing the subject.
The Manage | Database | Relationships layout is similiar to MS Access's (hope I don't get shot for saying that) Relationships and was pretty straight forward. The only thing I'm having any real problem with is getting my head wrapped around how to write and use the scripts.
I agree that Manage | Database | Relationships is very similar to the relationships form in MS Access. It wouldn't suprise me if some day I found out that it was part of the "inspiration" for this feature. Just keep in mind that most parts of the FileMaker App refer to "table" when it really means "table occurrence". Understanding TO's and how the control the function of your database can really help you take your database design to the next level.
Thanks for the pointers, parts of this are definite paradigm shifters.