When executing an UPDATE query in VBA can I use a variable as a field name? For example:
Dim myStudent as string
myStudent = Forms![frmMasterReportCard]![Student_Name]
mySQL = "UPDATE tblStudentCheck SET ["myStudent"] = '1';"
DoCmd.RunSQL mySQL
I am sure the problem is in the ["myStudent"] portion.
My plan is to send the name of the text box to a module and use this query there. This will save on a lot of coding if I can use the module.
Thanks.
Dim myStudent as string
myStudent = Forms![frmMasterReportCard]![Student_Name]
mySQL = "UPDATE tblStudentCheck SET ["myStudent"] = '1';"
DoCmd.RunSQL mySQL
I am sure the problem is in the ["myStudent"] portion.
My plan is to send the name of the text box to a module and use this query there. This will save on a lot of coding if I can use the module.
Thanks.