I have one table which has 3 columns: col1, col2, col3 which col1 is integer, and col2 is string
If I have one form with 2 text field, txt1, txt2
I want to update the table’s col1, col2 set the value to the given value text field. since txt1 and txt2 is input from user, if the txt1 or txt2 got null value, I have problem for updating:.
Here is my code:
If isnull(txt2.value) or txt2.value = “”
Val2 = “NULL”
Val2 = val(txt2.value)
StrSql = “update tbl1 set (col1, col2) = ( “ & val (txt1.value) & “, “ & txt2 & “) where col3 = ‘xxx’ “
Now i have no problem for the string null value of updating. but for col1, it's integer, if there is no input in the textbox, then myupdate have problem,
anyone know how to solve this problem??
Thank you very much