Selecting combo values based on another recordset

Results 1 to 2 of 2

Thread: Selecting combo values based on another recordset

  1. #1
    Join Date
    Dec 1969

    Default Selecting combo values based on another recordset

    HI,<BR><BR>I have two recodsets<BR>using one I am populating a combo box and using other I want to select couple of values<BR><BR>&#060;select MULTIPLE class=input required="1" name="FunctionalRoleID"&#062;<BR> &#060;option value="" selected&#062;&#060;/option&#062;<BR>g_ObjRSFunctionalRoles.movefirst<B R> do while not g_ObjRSFunctionalRoles.eof<BR><BR>&#060;option value=&#060;%=g_ObjRSFunctionalRoles(0)%&#062;&#06 2;&#060;%= g_ObjRSFunctionalRoles(1)%&#062;&#060;/option&#062; <BR><BR>g_ObjRSFunctionalRoles.movenext<BR> loop<BR><BR><BR>Now I have another recordset named <BR><BR>g_ObjRsFunctionalRolesSelected<BR><BR>No w I want to make appear selected the roles which are already assigned to a employee with this recordset.<BR><BR>I tried by having two loops and a if condition to check and then to make selected the value, but, I am getting duplicate values in the combo box.<BR><BR>So please sujjest me a way to sovle this problem<BR><BR>Thanks in advance<BR><BR>

  2. #2
    Andrew Brown Guest

    Default RE: Selecting combo values based on another record

    Hi<BR><BR>I just posted a message re the same topic.. I think I have a way to do it, but not sure<BR><BR>It will take a few steps, I think:<BR><BR>1. Build the &#039;selected&#039; option values from your RolesSelected recordset.<BR>2. Assigned the comma delimited selected values to a strVariable.<BR>3. Build the rest of the select box by including in your SQL select statement, soemthing like :<BR>select * from TABLE where Role NOT IN (strVariable)<BR>This will build the rest of the unselected items.<BR><BR>Not too efficient, but gets around the problem - not that I have tested.<BR><BR>Andrew

Posting Permissions

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