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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPDATE Statement question 1

Status
Not open for further replies.

accessguy52

Programmer
Sep 18, 2002
73
0
0
US
Hi everyone - didn't see my earlier question posted so thanks to the folks who replied with their INSERT INTO suggestions. Turns out that I really needed an UPDATE statement. But, that only seems to work on numeric flds. Any way to get UPDATE to work with text flds?

Thanks in advance.

accessguy52
 
I assume that you are buiding an SQL statement in code to Update your table. For text fields you must remember to enlose the value in quotes.

strSQL = "UPDATE myTable SET myField = """ & myStringVariable &
 
Thanks - your statement suggestion was close but, it only returned the variable name. Here's what I did, which worked:

strSQL = "UPDATE myTable SET myField = " & "'" & myStringVariable & "'" & ";"

By changing one of the double quotes to single quotes, it worked. Now why doesn't Microsoft tell us this?

Anyway, thanks again for giving me the push in the right direction.


accessguy52
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top