|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Listbox
hi!
I want to create a listbox for FUNCTION_CODE.. don't know how to do that When you then click on i.e. "H1" from the list it should then show the info from DESCRIPTION that belongs to "H1"... Did that make any sense.. the code I have now just shows the text from function_code and description... Code:
Sub Get_Category()
resrow = 3 'börjar vid cell 3,2
rescol = 2
Sheets("sheet1").Range("b2:j1000").ClearContents
OpenConnection ("RFC")
strQuery = "SELECT * FROM DESCRIPTIONS" 'DESCRIPTIONS = tabellnamn
Set Rs = ConnRFC.Execute(strQuery)
Do Until Rs.EOF
Sheets("sheet1").Cells(resrow, rescol).Value = Rs("FUNCTION_CODE")
Sheets("sheet1").Cells(resrow, rescol + 1).Value = Rs("DESCRIPTION")
resrow = resrow + 1
Rs.MoveNext
Loop
KillConnection ("RFC")
Mia Last edited by miiia83 : February 28th, 2007 at 02:10 AM. |
|
#2
|
|||
|
|||
|
Hi,
I'm not sure this will work but try this strQuery = "SELECT * FROM DESCRIPTIONS" 'DESCRIPTIONS = tabellnamn Set Rs = ConnRFC.Execute(strQuery) Do Until Rs.EOF Sheets("sheet1").Cells(resrow, rescol).Value = Rs("FUNCTION_CODE") rescol = rescol + 1 Sheets("sheet1").Cells(resrow, rescol).Value = Rs("DESCRIPTION") resrow = resrow + 1 Rs.MoveNext Loop KillConnection ("RFC") ------------------------- I've added this rescol = rescol + 1 between sheets() lines. Do the values write out to the page? |
|
#3
|
|||
|
|||
|
that only made it jump a step down and a step to the side for every textrow...
the problem isn't to get the text shown... I want it to be shown as a listbox! |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Listbox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|