Question : Problem with DoCmd.RunSQL "INSERT INTO " and memo fields

I have some code that copies the contents of some fields from one product when creating a new product. It works fine except for the memo fields, they come out half empty and half filled with weird symbold and text. The code is simply

DoCmd.RunSQL "INSERT INTO"

followed by about 50 fields. And as I said all field types work except for memo fields. Any ideas?

Answer : Problem with DoCmd.RunSQL "INSERT INTO " and memo fields

Use a recordset instead

dim rs as dao.recordset

set rs=currentdb.openrecordset("mytable")

rs.addnew

rs!field1 = somevalue
rs!field2 = somememovalue

rs.Update

rs.close
set rs=nothing

Random Solutions  
 
programming4us programming4us