Since my last lot of issues with my database (thanks for your help guys) things have been going much better. I think I'm beginning to get a better handle on VBA. However I've hit a new hurdle. Any advice would be greatly appreciated.
As a quick bit of background, I'm building a database for work, to house equipment records (including test information). Equipment is stored in sets and each set can have many items. I've set up the database so the generic set information is stored in one table (tblSet) and individual weight (as that's the bit I'm working on now) information is stored in another table (tblWeight). I've built a tabbed form, which shows the generic information on one tab and the individual weight information on a second.
All equipment (either the whole set or individual items) has the option of being listed as missing, quarantined or out of service. What I'm attempting to do is set up some VBA code so that when the user clicks on (for example) "Missing" in the set tab, each item within the set is updated to also be shown as "Missing" (N.B. the Missing option is a checkbox).
From what I've found I need a combination of a Find record, find next and loop (with the command to change the checkbox to true). I've been having a dig round, but am struggling with the coding, can't quite get my head around it (despite MS Access help files). So far all I've found that makes a vague kind of sense is:
If I've understood it correctly I'm telling the programme to search for all instances of the set ID currently being displayed and that the search should be case sensitive and search for data as its formatted. What I can't work out is how to tell it to search for this in the form subfrmWeightA! (linked to tblWeight) rather than form frmSet (linked to tblSet). The Set ID is the primary key in the set table and secondary key in the weight table.
Once I've worked out how to find the records the update I intend to use is:
Forms!frmSet!subfrmWeightA!WeightMissing = True
Forms!frmSet!subfrmWeightA!WeightComments = Forms!frmSet!subfrmWeightA!WeightComments & " The set was recorded as missing on: " & strInput
Note: strInput requires the user to input the date the set went missing, the code for updating the weight records will come after the user prompt.