im trying to write a SQL statement that will update a column in my access database based on a selection chosen from a form. the select box in the form is called STEP. the values range from A_DATE to U_DATE. there also two textboxes, one called "CONNUM" and one called "ENTDATE". the database has columns called "CON_NUM" and others, ranging from A_DATE to U_DATE. an example: the user chooses STEP = A_DATE, then enters 3002 in CONNUM, and 12/23/2004 in ENTDATE. when they submit, the database should update column A_DATE with 12/23/2004 WHERE CON_NUM=3002. im kinda familar with SQL but just can not get this to work. here's my code so far:
sql="UPDATE CONTRACTS SET '"& putSTEP &"' = '" & putENTDATE & "' WHERE CON_NUM = '"& putCONNUM & "'"
if i replace '"& putSTEP &"' with A_DATE, it works. however, if i did it that way, i'd have to write IF and SQL statements for each STEP from A_DATE to U_DATE. any ideas?
thanks in advance for the help.