Hey,
I've got 3 tables, and a form for entering new records to table 1. I want to take the number entered for one of the fields on that form away from the number stored in a specific record in table 2. The three tables are linked (1 to 3 by an ID number, and 3 to 2 by a keyfield) so there will always be only one record to be found to alter in table 2
I tried to write this but I kept getting errors, and I haven't the knowledge to extract table data in VBA properly anyway, which isn't helpful.
I've written code to grab the number and ID I want from the form, and I can handle the validation on the number field I need to pull out, (making sure it's more than or equal to the number, and giving an error if it isn't) and I can alter the field with DoCmd.RunSQL, so I just need to:
*Grab the Keyfield from table 3 by looking up the ID field from the form;
*Grab the number field from the record in table 2 which has the same keyfield as the keyfield I pulled out;
I tried doing this with DoCmd.RunSQL, but it's a method not a function (D'oh!). I then tried recordsets but they were quite confusing and overcomplicated, and didn't work anyway.
Help? :S
I've got 3 tables, and a form for entering new records to table 1. I want to take the number entered for one of the fields on that form away from the number stored in a specific record in table 2. The three tables are linked (1 to 3 by an ID number, and 3 to 2 by a keyfield) so there will always be only one record to be found to alter in table 2
I tried to write this but I kept getting errors, and I haven't the knowledge to extract table data in VBA properly anyway, which isn't helpful.
I've written code to grab the number and ID I want from the form, and I can handle the validation on the number field I need to pull out, (making sure it's more than or equal to the number, and giving an error if it isn't) and I can alter the field with DoCmd.RunSQL, so I just need to:
*Grab the Keyfield from table 3 by looking up the ID field from the form;
*Grab the number field from the record in table 2 which has the same keyfield as the keyfield I pulled out;
I tried doing this with DoCmd.RunSQL, but it's a method not a function (D'oh!). I then tried recordsets but they were quite confusing and overcomplicated, and didn't work anyway.
Help? :S