OLE problem

S

Shell

I used VBA to insert a picture into a table from a form field. But it show
string syntax error. My code are as following:
Stemp = "Insert into FG_PN"
Stemp = Stemp &
"(FGPN,Description,MOQ,Unit,NetWeight,GrossWeight,Cavity,CTN,EOL,[Picture1])"
Stemp = Stemp & "Values('" & Me!FGPN & "','" & Me!Description & "',"
Stemp = Stemp & "'" & Me!MOQ & "','" & Me!Unit & "',"
Stemp = Stemp & "'" & Me!NetWeight & "','" & Me!GrossWeight & "',"
Stemp = Stemp & "'" & Me!Cavity & "','" & Me!CTN & "',"
Stemp = Stemp & "'" & Me!EOL & "','" & Me![Picture1] & "')"
DoCmd.RunSQL Stemp
MsgBox "Record has been saved successfully!", vbOKOnly, "Save Complete"
Me![FG_PN subform].Requery

Would you please give me some instruction on this issue? ([Picture1] is an
OLE field)
 
P

Pieter Wijnen

No Can Do
You have To Use The AppendChunk method of a (DAO) Recordset to Append a Blob
to a table

HTH

Pieter
 
Top