vivasuzi
Programmer
- Jun 14, 2002
- 183
Hi,
I have a line of code that (when you select from the drop down) opens up the matching record.
Here it is...
But then I encountered a Problem when I came to a companyname that had a single quote, so I changed it to this...
Now my problem is that this doesn't work at all. If I change it to only replace in the combo it works for everything except the company names that have a single quote in them (code follows)
However as I said, the above line does not work if the company has a single quote. What am I writing wrong? Please help :-D
*Suzanne* ![[elephant2] [elephant2] [elephant2]](/data/assets/smilies/elephant2.gif)
![[wiggle] [wiggle] [wiggle]](/data/assets/smilies/wiggle.gif)
I have a line of code that (when you select from the drop down) opens up the matching record.
Here it is...
Code:
Me.RecordsetClone.FindFirst "[COMPANYname] = '" & Me![Combo28] & "'"
But then I encountered a Problem when I came to a companyname that had a single quote, so I changed it to this...
Code:
Me.RecordsetClone.FindFirst "Replace([COMPANYname], “’”, “’’”) = '" & Replace(Me![Combo28], “’”, “’’”) & "'"
Now my problem is that this doesn't work at all. If I change it to only replace in the combo it works for everything except the company names that have a single quote in them (code follows)
Code:
Me.RecordsetClone.FindFirst "[COMPANYname] = '" & Replace(Me![Combo28], “’”, “’’”) & "'"
However as I said, the above line does not work if the company has a single quote. What am I writing wrong? Please help :-D
![[cat2] [cat2] [cat2]](/data/assets/smilies/cat2.gif)
![[elephant2] [elephant2] [elephant2]](/data/assets/smilies/elephant2.gif)
![[wavey] [wavey] [wavey]](/data/assets/smilies/wavey.gif)
![[wiggle] [wiggle] [wiggle]](/data/assets/smilies/wiggle.gif)