Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a recordset

Status
Not open for further replies.

Anthony1312002

Programmer
Mar 4, 2004
146
US
I have a form that's connected to an Access table. In the table I have a yes/no field called Tran01903. In my form I also have a checkbox called Tran01903. What I'm trying to do is make possible for me to update the table when I either check or uncheck the checkbox in the form. I'm using the code below but it's not working. Presently it leaves the field empty no matter what I do. Any thoughts on how to do this?


sql_update1903 = "UPDATE CustomerBoxes SET Tran01903 = "
If Request.Form("Tran1903") <> False then
sql_update1903 = sql_update1903 & "True"
Else
sql_update1903 = sql_update1903 & "False"
End If
'And finally the WHERE portion
sql_update1903 = sql_update1903 & " WHERE CustomerID = 170 "
'Make it so!
conn.Execute sql_update1903
 
try using 1 and 0 instead of True and False...
Code:
If Request.Form("Tran1903") <> False then
  sql_update1903 = sql_update1903 & "1"
Else
  sql_update1903 = sql_update1903 & "0"
End If

Tony
________________________________________________________________________________
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top