Hi
I'm using Access 2000 and DAO.
I have a form with fields that include "Date" and six categories listed as the array "DefectType". Each category has an associated text box with the word "Box" suffixed to the category name.
On submission, I wish to check the contents of the text box for each field, and if it doesn't contain the word satisfactory, write the contents of the text box to a new record in the table "Defects".
Running the query below creates an "Argument not optional" compile error at DoCmd.RunSQL. Any help appreciated.
Thanks
For Check2 = 0 To 5
If Me(DefectType(Check2)) <> "Satisfactory" Then
DoCmd.RunSQL 'INSERT INTO Defects (Reported, Type, Description) VALUES ("'& Me[Date] &'", "'& Me(DefectType(Check2)) &'", "'& Me(DefectType(Check2))' & 'Box'") '
End If
Next
I'm using Access 2000 and DAO.
I have a form with fields that include "Date" and six categories listed as the array "DefectType". Each category has an associated text box with the word "Box" suffixed to the category name.
On submission, I wish to check the contents of the text box for each field, and if it doesn't contain the word satisfactory, write the contents of the text box to a new record in the table "Defects".
Running the query below creates an "Argument not optional" compile error at DoCmd.RunSQL. Any help appreciated.
Thanks
For Check2 = 0 To 5
If Me(DefectType(Check2)) <> "Satisfactory" Then
DoCmd.RunSQL 'INSERT INTO Defects (Reported, Type, Description) VALUES ("'& Me[Date] &'", "'& Me(DefectType(Check2)) &'", "'& Me(DefectType(Check2))' & 'Box'") '
End If
Next