[Resolved] - RunSQL Macro - Can't figure it out!
Hi All...
I have a subform, embedded into another form.
Main Form = frmBackloadEdit (The "backload" details - linked to tblBackloads)
Subform 1 = subfrmBackloadItems (A filtered list of items from the tblItems table, that have the tblBackload.ID field in the tblItems.Backload field.)
Subform 2 = subfrmBackloadAddItems (A list of ALL items in the tblItems table, that have nothing in the tblItems.Backload field)
I am trying to get it so when a user clicks on the ADD link of the second subform, it adds the tblBackload.ID field to the tblItems.Backload field.
I am using a MACRO, as I have been instructed explicitly to not use VBA code (for reasons I can't get into here!)
I am currently using the RunSQL command in the macro editor, however, when the user clicks the ADD link, it updates ALL the records, instead of just the one the user clicks. I believe I've used the correct syntax, however can't seem to rectify the problem.
The current SQL code in the runSQL command looks like this....
UPDATE tblItems SET tblItems.Backload = Forms![frmBackloadEdit]![ID] WHERE tblItems.ID = [ID]
I have tested the [ID] field using a msgbox, and it is returning the correct ID on the click, however it's not 'isolating' the record using the above SQL statement.....
PLEASE HELP!!!
Thanks,
Dan Wall.
I have attached the DB in case anyone is interested in tearing it apart. (Access 2007)
Hi All...
I have a subform, embedded into another form.
Main Form = frmBackloadEdit (The "backload" details - linked to tblBackloads)
Subform 1 = subfrmBackloadItems (A filtered list of items from the tblItems table, that have the tblBackload.ID field in the tblItems.Backload field.)
Subform 2 = subfrmBackloadAddItems (A list of ALL items in the tblItems table, that have nothing in the tblItems.Backload field)
I am trying to get it so when a user clicks on the ADD link of the second subform, it adds the tblBackload.ID field to the tblItems.Backload field.
I am using a MACRO, as I have been instructed explicitly to not use VBA code (for reasons I can't get into here!)
I am currently using the RunSQL command in the macro editor, however, when the user clicks the ADD link, it updates ALL the records, instead of just the one the user clicks. I believe I've used the correct syntax, however can't seem to rectify the problem.
The current SQL code in the runSQL command looks like this....
UPDATE tblItems SET tblItems.Backload = Forms![frmBackloadEdit]![ID] WHERE tblItems.ID = [ID]
I have tested the [ID] field using a msgbox, and it is returning the correct ID on the click, however it's not 'isolating' the record using the above SQL statement.....
PLEASE HELP!!!
Thanks,
Dan Wall.
I have attached the DB in case anyone is interested in tearing it apart. (Access 2007)
Attachments
Last edited: