Results 1 to 2 of 2

Thread: Listbox itemdata?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Posts
    114

    listbox

    Lets say that your list box can hold 20 characters across and then all characters after that get cut off. So what you could do with your primary key is put that value in position 25 or somthing like that. For example let say your key is '10' you would put this string when adding the item -
    list1.additem left$(StringFromTable + space$(24), 24) + yourkey.

    So this is only going to show '10 ' and then the primary key is going to be cut off from the list box.

    derek

  2. #2
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    Thanks, but I already got it.

    Code:
    function query2htmList(myquery,myname,myDSN)
    	dim conntemp, rstemp
    	set conntemp=server.createobject("adodb.connection")
    	
    	conntemp.open myDSN
    	set rstemp=conntemp.execute(myquery)
    	
    	query2HTMlist="<Select name='" & myname & "'>"
    	do until rstemp.eof
    		thisfield=trim(RStemp(1))
    		thisid=RStemp(0)
    		if not isnull(thisfield) or thisfield<>"" then
    			query2HTMlist=query2HTMlist & "<option value=" & thisid & ">" & thisfield & "</option>"
    		end if
    		rstemp.movenext
    	loop
    	query2HTMlist=query2HTMlist & "</select>"
    	rstemp.close
    	set rstemp=nothing
    	conntemp.close
    	set conntemp=nothing
    end function

Posting Permissions

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



Click Here to Expand Forum to Full Width