Unprintable characters to distinguish records?

bigzebra

New member
Local time
Today, 09:12
Joined
Aug 20, 2009
Messages
6
I have an Access 2003 database that uses last name as primary key.
I have a webpage I'm developing that will search the database based on names in a drop down list.
There are duplicate last names, eg Smith, Brian and Smith, Jack in the database.
Can I imbed an unprintable character in the dropdown list name and database name fields for a record to distinguish it from the other, so then one searches for Brian Smith, that one will show up instead of Jack Smith?

Example from the dropdown, where x = unprintable character:
<option value="Smithx">Brian Smith</option>
<option value="Smith">Jack Smith</option>

If so, how would I do that, just add a 'cntl-C' unprintable character for 'End of Text' or some other character? Any other solutions?

Thanks.
 
The option value should be the record ID of the name, not the name itself.
 
Excellent! So I should add a record ID field to my database? There isn't one there now. There are 152 records in the database. Thanks.
 
Yes, and you can just use an autonumber field to do it and when you add it in, be sure to set it as the PRIMARY KEY (by putting your cursor in the field name while in design view and then click the little KEY icon on the tool bar). That way you have a unique identifier for each row of data.
 

Users who are viewing this thread

Back
Top Bottom