Question Insert to Access DB Hyperlink (1 Viewer)

mstres

Registered User.
Local time
Today, 09:17
Joined
Mar 18, 2009
Messages
24
I have simple form with 3 unbound text boxes. One text box get path (Hyperlink) from OpenFileDialog box.
On Save using simple sql statement as
strsql = "INSERT INTO fs_attachment_tbl (Attachment_Type_Id, Hyperlink, Site_id)" & _
" VALUES(" & Me.cboAttachmentType & ", '" & me.txtFilePath & "', " & Me.Site_ID & ")"
CurrentDb.Execute strsql
And I have error description:
Syntax error in string in query expression ''C:\Comcast\documents\Work Order System Overview\CCS Work Order System (v 6.3).doc'.
Err.Number = 3075
When I copied this path to the MS word from text box and after that I copied from MS word back to text box.
No Error appeared during the same insert statement.
Record was saving successful
How I can save record with hyperlink
Thank you
Mikhail
 
Last edited:

zoran.eremija

New member
Local time
Today, 18:17
Joined
May 30, 2013
Messages
7
Try the following
strsql = "INSERT INTO fs_attachment_tbl ( Attachment_Type_Id, Hyperlink, Site_id ) SELECT " & Me.cboAttachmentType & ", " & Me.txtFilePath & ", " & Me.Site_ID & ";"
 

mstres

Registered User.
Local time
Today, 09:17
Joined
Mar 18, 2009
Messages
24
Thank you for your help. I did try did not work.
I give you more information:
1.This is unbound form. If I bound form and controls to DB, I have no error and I can save record with this comand: DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

2.Access DB I am using as link to MySQL database and field type is mediumtext. When I do save as bound controls it is save as Binary/image.
I did try to change data type to varchar 255 did not help.

Thank you again for you help!!!
 

Users who are viewing this thread

Top Bottom