hi Doyce,
great! you're welcome.
Now that it works there, lets back up. Instead of changing that line, change where it gets assigned:
strComboVar = Me.cboVendor
to -->
with Me.cboVendor
if not isnull(.value) then
strComboVar =Replace( .value, "'", "''")
else
'------- ??? exit?
end if
end with
have an awesome day,
crystal
Crystal,
That's perfect! Thank you!!
Doyce
---In MS_Access_Professionals@yahoogroups.com, <strive4peace2008@...> wrote :
hi Doyce,
"[COMNAM_08] ='" & Replace( strComboVar, "'", "''") & "'"
have an awesome day,
crystal
On 9/6/17 3:18 PM, winberry.doyce@... [MS_Access_Professionals] wrote:
Pros,
I have a combo box that looks up Vendors by vendor name. I just observed that if the Vendor name has an apostrophe in it like "Page's Upholstery", the after update event of the combo box errors. What can I do to fix that? Here is the code:
Dim RS As DAO.Recordset
Dim strComboVar As StringstrComboVar = Me.cboVendor
If Len(cboVendor & vbNullString) <> 0 Then
Me.Filter = ""
Me.FilterOn = False
Set RS = Me.Recordset
RS.FindFirst "[COMNAM_08] ='" & strComboVar & "'"
If Not RS.NoMatch Then Me.Bookmark = RS.Bookmark
Set RS = Nothing
End If
Doyce
Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar