Forums

This topic is locked

2 fields into 1 listbox

Posted 18 Oct 2001 05:58:58
1
has voted
18 Oct 2001 05:58:58 Michael Rudge posted:
How can I have both fName and LName display as the label in a list/select box and the value be = to the primary key/autonumber field of that record?

Michael Rudge

Replies

Replied 18 Oct 2001 12:18:38
18 Oct 2001 12:18:38 Owen Eastwick replied:
This should do the trick:

First set up the list/menu using the database table as usual, using the FirstName field as the Item Label and the RecordID field as the Value.

Then modify the the code as follows:

From This:

<option value="<%=(YourRecordsetName.Fields.Item("RecordIDField".Value)%>" ><%=(YourRecordsetName.Fields.Item("FirstNameField".Value)%></option>

To This:

<option value="<%=(YourRecordsetName.Fields.Item("RecordIDField".Value)%>" ><%=(YourRecordsetName.Fields.Item("FirstNameField".Value) & " " & (YourRecordsetName.Fields.Item("LastNameField".Value)%></option>

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 18 Oct 2001 17:14:59
18 Oct 2001 17:14:59 Michael Rudge replied:
Excellent! Thanks a ton Owen! I tried a variable and a loop but not the results I wanted and not as efficent. Thanks again!

Michael Rudge

Reply to this topic