I'm currently creating an Access 2000 database to keep track of
employee vacation hours. I have a form in which the number of hours
requested off by an employee is entered into a text box. Then the
employee's remaining vacation hours are updated through a SQL update
statement. I build the SQL statement through VBA and then execute it.
Here is what my SQL looks like:
strSQL = "UPDATE Employee SET VacationTime = "
strSQL = strSQL & intNewVacation & ", "
strSQL = strSQL & "SickPersonalTime = "
strSQL = strSQL & intNewPersonal & " "
strSQL = strSQL & "WHERE EmployeeID = "
strSQL = strSQL & Me.cboEmployee.Value
Would it be more appropriate to move "me.cboEmployee.value" into a
variable, and then use the variable in the SQL statement? Or does it
even matter? I just want to be aware of any problems that might
occur. I have several SQL statements that I build this way, and I
would just like some input.
Thanks in advance for your reply,
Andrea