D
Dan
I need to run a insert sql statement into one of my
tables. As you can see, the sub get arguments that need to
be put into the sql statement. The problem that I am
getting is that if the BD argument has a single quote in
its value (Ex: 10' feet CAT5 Cable), the sql statement
returns a error. How can you make the statement handle
strings that have a single quote.
Dan
=======================================================
Public Sub BUNDLE(PON, ID, UP, itid, QTY, BD, p)
Dim i As Integer 'counter
DoCmd.SetWarnings (warningsoff)
i = 0
Do Until i = QTY
DoCmd.RunSQL ("Insert Into tbl_po_details ([POID],[ItemID],
[DESCRIPTION],[Quantity],[Unit_Price],
[ITEM_TYPE_ID_FOR_SELECTION],[GROUP_ON_PO],[PRODUCT])
values (" & PON & "," & ID & ",'" & BD & "',1," & UP & ","
& itid & ",-1,'" & p & "')")
End Sub
tables. As you can see, the sub get arguments that need to
be put into the sql statement. The problem that I am
getting is that if the BD argument has a single quote in
its value (Ex: 10' feet CAT5 Cable), the sql statement
returns a error. How can you make the statement handle
strings that have a single quote.
Dan
=======================================================
Public Sub BUNDLE(PON, ID, UP, itid, QTY, BD, p)
Dim i As Integer 'counter
DoCmd.SetWarnings (warningsoff)
i = 0
Do Until i = QTY
DoCmd.RunSQL ("Insert Into tbl_po_details ([POID],[ItemID],
[DESCRIPTION],[Quantity],[Unit_Price],
[ITEM_TYPE_ID_FOR_SELECTION],[GROUP_ON_PO],[PRODUCT])
values (" & PON & "," & ID & ",'" & BD & "',1," & UP & ","
& itid & ",-1,'" & p & "')")
End Sub