Drop down menu comprising two fields from same db

Results 1 to 2 of 2

Thread: Drop down menu comprising two fields from same db

  1. #1
    Join Date
    Dec 1969

    Default Drop down menu comprising two fields from same db

    Hello.<BR>Anyone know if it&#039;s possible to combine two columns from the same db table in one drop down menu for users to select??? I&#039;m using the following syntax <BR><BR>While (NOT rsfullname.EOF)<BR>%&#062;<BR> &#060;option value="&#060;%=(rsfullname.Fields.Item("employeeID ").Value)%&#062;" &#060;%If (Not isNull(rsfullname.Fields.Item("ee_lname").Value & ", " & rsfullname.Fields.Item("fname").Value)) <BR><BR>Then If <BR>(CStr(rsfullname.Fields.Item("employeeID").Val ue) = CStr(rsfullname.Fields.Item("ee_lname").Value & ", " & rsfullname.Fields.Item("fullname").Value)) <BR>Then <BR>Response.Write("SELECTED") : Response.Write("")%&#062; &#062;<BR>&#060;%=(rsfullname.Fields.Item("ee_lnam e").Value)%&#062;&#060;/option&#062;<BR>&#060;% rsfullname.MoveNext()<BR>Wend<BR>If (rsfullname.CursorType &#062; 0) Then<BR> rsfullname.MoveFirst<BR>Else<BR> rsfullname.Requery<BR>End If<BR>%&#062;<BR><BR>but I can only get it to return the last name in the list.<BR>Any suggestions?

  2. #2
    Join Date
    Dec 1969

    Default Can you explain...

    ...*WHAT* you are trying to do? WITH WORDS, not code?<BR><BR>That&#039;s some incredibly ugly code in there, and *surely* there&#039;s a better way.<BR><BR>For starters, *THIS* chunk makes zero sense (I&#039;ve broken it up into multiple lines to make it clearer where the parens relate to):<BR><BR>If (<BR> Not isNull(<BR> rsfullname.Fields.Item("ee_lname").Value _<BR> & ", " _<BR> & rsfullname.Fields.Item("fname").Value<BR> )<BR>) <BR><BR>That expression you have as the argument to the isNull(...) function will *NEVER* be NULL! Even if the two form fields were null, you are concatenating them with [hl="yellow"]", "[/hl] and that is most *certainly* not null.<BR><BR>SO that IF test you are doing is WORTHLESS. You might just as well have coded<BR><BR>IF TRUE THEN<BR><BR>in place of all that stuff.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts