Apostrophe in a drop list

J

jeanulrich00

Hi

I Have a drop list containin Cities name.

User select a City from the list then the form show all cutomers from
the selected city.

The problem is that I have a lot of frenc City names like:
l'Assomtion
l'Epiphanie
and everytime I select a city containing an aportrophe that produce an
error.

As I want to keep cities name the way they should be, is there a way
to manage that

thanks
 
D

Douglas J. Steele

Presumably you've got a filter that checks using code like

strFile = "[City] = '" & Me.cboCity & "'"

Change that to

strFile = "[City] = '" & Replace(Me.cboCity, "'", "''") & "'"

Exagerated for clarity, that's

strFile = "[City] = '" & Replace(Me.cboCity, " ' ", " ' ' ") & "'"
 
Top