J
jcr50
Guest
Hope someone can help, I have a form with a listbox that uses a query as the recordsource. The query selects a few fields from a table, including word documents that are stored as OLE objects. The query is selecting these objects no prob.
Now, on the click of a button, I have a statement that loops through all of the selected items in the list, and inserts those values into another table. The statement works except the OLE object. In the code below, the OLE object is being inserted into EndorsementText and the value is Me.lstEndorsements.Column(3, varItem).
My main question is how do I handle this? I know that to insert text you need quotes around the variable, for dates you need #'s, but what about inserting OLE objects?
I hope this isn't too confusing, or stupid, but can someone please help me out?
DoCmd.RunSQL "INSERT INTO PolicyFormEndorsment(EndorsementID, EndorsementNumber, EndorsementName, QuoteID, EndorsementText) VALUES " & "(" & Me.lstEndorsements.Column(0, varItem) & "," & Chr(39) & Me.lstEndorsements.Column(1, varItem) & Chr(39) & "," & Chr(39) & Me.lstEndorsements.Column(2, varItem) & Chr(39) & "," & intQid & "," & Me.lstEndorsements.Column(3, varItem) & ")"
Thanks in advance,
Now, on the click of a button, I have a statement that loops through all of the selected items in the list, and inserts those values into another table. The statement works except the OLE object. In the code below, the OLE object is being inserted into EndorsementText and the value is Me.lstEndorsements.Column(3, varItem).
My main question is how do I handle this? I know that to insert text you need quotes around the variable, for dates you need #'s, but what about inserting OLE objects?
I hope this isn't too confusing, or stupid, but can someone please help me out?
DoCmd.RunSQL "INSERT INTO PolicyFormEndorsment(EndorsementID, EndorsementNumber, EndorsementName, QuoteID, EndorsementText) VALUES " & "(" & Me.lstEndorsements.Column(0, varItem) & "," & Chr(39) & Me.lstEndorsements.Column(1, varItem) & Chr(39) & "," & Chr(39) & Me.lstEndorsements.Column(2, varItem) & Chr(39) & "," & intQid & "," & Me.lstEndorsements.Column(3, varItem) & ")"
Thanks in advance,