L
Lord-Data
I've got a form that uses a SQL insert statement to put the contents of its
fields into a MS Access 97 database ..
using the following statement:
CurrentDb.Execute " INSERT INTO Repairs ( ID, JobDate, Supplier,
SupplierAddress, Article, " _
& "ProductDescription, Quantity, RA, PO, Serial, Reason, " _
& "CustomerName, CustomerCompany, CustomerAddress, PhoneBH, " _
& "PhoneAH, Carrier, CarrierCon, DespatchDate, JobComments, " _
& "CustomerOwned, Waranty, Teammember, CompletedFlah) " _
& "VALUES (" & Form.ID.Value & ", " & Form.JobDate.Value & ", '" &
Form.Combo92.Value & "' , '" & Form.SupplierAddress.Value & "', '" &
Form.Article.Value & "', " _
& "'" & Form.ProDesc.Value & "', " & Form.QTY.Value & ", '" &
Form.RA.Value & "', " & Form.PO.Value & ", '" & Form.Serial.Value & "', '" &
Form.Reason.Value & "', " _
& "'" & Form.CustomerName.Value & "', '" & Form.CustomerCompany.Value &
"', '" & Form.CustomerAddress.Value & "', '" & Form.PhoneBH.Value & "', " _
& "'" & Form.PhoneAH.Value & "', '" & Form.Carrier.Value & "', '" &
Form.CarrierCon.Value & "', " & Form.DespatchDate.Value & ", '" &
Form.JobComments.Value & "', " _
& "" & Form.CustomerOwned.Value & ", " & Form.Repair.Value & ", '" &
Form.TeamMember.Value & "', No" _
& ");"
Excuse the size
This works flawlessly most of the time, except when there is a quote in the
fields to be entered ..
Is there a way around this? This final product will be used by non computer
literate people, so I can't just avoid using signal quotes.. they will have
to be handled .. How can I accomplish this?
Thanks in advance!
fields into a MS Access 97 database ..
using the following statement:
CurrentDb.Execute " INSERT INTO Repairs ( ID, JobDate, Supplier,
SupplierAddress, Article, " _
& "ProductDescription, Quantity, RA, PO, Serial, Reason, " _
& "CustomerName, CustomerCompany, CustomerAddress, PhoneBH, " _
& "PhoneAH, Carrier, CarrierCon, DespatchDate, JobComments, " _
& "CustomerOwned, Waranty, Teammember, CompletedFlah) " _
& "VALUES (" & Form.ID.Value & ", " & Form.JobDate.Value & ", '" &
Form.Combo92.Value & "' , '" & Form.SupplierAddress.Value & "', '" &
Form.Article.Value & "', " _
& "'" & Form.ProDesc.Value & "', " & Form.QTY.Value & ", '" &
Form.RA.Value & "', " & Form.PO.Value & ", '" & Form.Serial.Value & "', '" &
Form.Reason.Value & "', " _
& "'" & Form.CustomerName.Value & "', '" & Form.CustomerCompany.Value &
"', '" & Form.CustomerAddress.Value & "', '" & Form.PhoneBH.Value & "', " _
& "'" & Form.PhoneAH.Value & "', '" & Form.Carrier.Value & "', '" &
Form.CarrierCon.Value & "', " & Form.DespatchDate.Value & ", '" &
Form.JobComments.Value & "', " _
& "" & Form.CustomerOwned.Value & ", " & Form.Repair.Value & ", '" &
Form.TeamMember.Value & "', No" _
& ");"
Excuse the size
This works flawlessly most of the time, except when there is a quote in the
fields to be entered ..
Is there a way around this? This final product will be used by non computer
literate people, so I can't just avoid using signal quotes.. they will have
to be handled .. How can I accomplish this?
Thanks in advance!