Dear All,
I've been using SQL Insert method for quite a while, and always get the best result I wanted, except for this one,the text with top right comma " ' " , it will stop the SQL insert. Can this be solved?
Here is the code:
Dim strSQL As String
strSQL = "INSERT INTO tblSubRoomingList (SeqNo, CityBookingID, SRLGroupID, ChineseName, EnglishName, GuestGender, PassportNumber, " & _
"DateOfBirth, Birthplace, PlaceOfIssue, IssuingDate, ExpiryDate, GuestType, RoomType, Remark) " & _
"SELECT tblRoomingList.SeqNo, " & Nz(Me.CityBookingID, 0) & ", " & Me.CBGroupID & ", tblRoomingList.ChineseName, " & _
"tblRoomingList.EnglishName, tblRoomingList.GuestGender, tblRoomingList.PassportNumber, tblRoomingList.DateOfBirth, " & _
"tblRoomingList.Birthplace, tblRoomingList.PlaceOfIssue, tblRoomingList.IssuingDate, tblRoomingList.ExpiryDate, " & _
"tblRoomingList.GuestType, tblRoomingList.RoomType, tblRoomingList.Remark " & _
"FROM tblRoomingList " & _
"WHERE tblRoomingList.GroupID = " & Me.CBGroupID
CurrentDb.Execute strSQL, dbFailOnError
Me.Requery
If the "EnglishName" contains " ' ",It won't start the process. Please help! Thanks.
Best Regards,
Kevin
Posted by: Qingqing <qingqinga@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
Tidak ada komentar:
Posting Komentar