Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox: Does not like name

Status
Not open for further replies.

idavis1900

Technical User
Dec 17, 2008
18
I have a comboBox that as row source of this:

SELECT DISTINCT tblPerson.Member FROM tblPerson;

names like davis, smith, jones will fill the form in with information about which name I pick.

But a name like O'Dowd, does not fill the form in. The form stays blank.

Thanks for any help in advance.

Irene
 
It would be best to use:

SELECT tblPerson.ID, tblPerson.Member FROM tblPerson;

This is boith more accurate and safer. If you table does not have a unique id, it really should.

That being said, you are probably using something like:

[tt]rs.FindFirst "Surname='" & Me.cboCombo & "'"[/tt]

This is a problem, you need:

[tt]rs.FindFirst "Surname='" & Replace(Me.cboCombo,"'","''") & "'"[/tt]

If fact, you will often need to replace single quotes with two single quotes for text fields.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top