R
Rajesh Candamourty
Dear All,
I have an Access database where in I take the input of the users and save to a table. While saving, Am using an SQL INSERT statement;
quote is a string with value ""
sqlstr = " insert into [P&IC Request1]"
sqlstr = sqlstr & "(Status, ItemNo, Contact, RelatedDoc, PartNo, PartNoDesc) values ("
sqlstr = sqlstr & quote & cboStatus.Value & quote & ","
sqlstr = sqlstr & quote & ItemNo.Value & quote & ","
sqlstr = sqlstr & quote & Contact.Value & quote & ","
sqlstr = sqlstr & quote & InitiatingDoc.Value & quote & ","
sqlstr = sqlstr & quote & cboPartNo.Value & quote & ","
sqlstr = sqlstr & " ' " & PartDesc.Value & " ' " & ","
sqlstr = sqlstr & ")"
I am using single quotes for the part number description since I have inches(") in the description sometimes.
In the form there is field which displays a part number description. The part number description is like - FOAM,ASSY,END, 35" X 30" or SHELL, END, 33" or sometimes RIK 2200 FLUID OVERLAY,INT'L
The program saves to table with the first two part number descriptions.
If you take a close look, the last part number description which is in bold, has a single quote (') in the description. While saving a record the program throws an error at this point.
I would appreciate if anybody gives a work around for this.
Thanks in advance.
Raj.
I have an Access database where in I take the input of the users and save to a table. While saving, Am using an SQL INSERT statement;
quote is a string with value ""
sqlstr = " insert into [P&IC Request1]"
sqlstr = sqlstr & "(Status, ItemNo, Contact, RelatedDoc, PartNo, PartNoDesc) values ("
sqlstr = sqlstr & quote & cboStatus.Value & quote & ","
sqlstr = sqlstr & quote & ItemNo.Value & quote & ","
sqlstr = sqlstr & quote & Contact.Value & quote & ","
sqlstr = sqlstr & quote & InitiatingDoc.Value & quote & ","
sqlstr = sqlstr & quote & cboPartNo.Value & quote & ","
sqlstr = sqlstr & " ' " & PartDesc.Value & " ' " & ","
sqlstr = sqlstr & ")"
I am using single quotes for the part number description since I have inches(") in the description sometimes.
In the form there is field which displays a part number description. The part number description is like - FOAM,ASSY,END, 35" X 30" or SHELL, END, 33" or sometimes RIK 2200 FLUID OVERLAY,INT'L
The program saves to table with the first two part number descriptions.
If you take a close look, the last part number description which is in bold, has a single quote (') in the description. While saving a record the program throws an error at this point.
I would appreciate if anybody gives a work around for this.
Thanks in advance.
Raj.