String manipulation

4 posts / 0 new
Last post
Pawelski_33
Offline
Joined: 06/05/2018 - 12:16
String manipulation

Hi All,
Need some help with string manipulation.
Here is my original array definition:
        UserChoice(0)= ListOfColumns(dlg.DropListBox1) 'Ref
        UserChoice(1)= ListOfColumns(dlg.DropListBox2) 'Value
UserChoice(2)= ListOfColumns(dlg.DropListBox3) 'Dr
       UserChoice(3)= ListOfColumns(dlg.DropListBox4) 'Cr
       UserChoice(4)= ListOfColumns(dlg.DropListBox5) 'Date
UserChoice(5)= ListOfColumns(dlg.DropListBox6) 'Prepared ID
               UserChoice(6)= ListOfColumns(dlg.DropListBox7) 'Account No
       UserChoice(7)= ListOfColumns(dlg.DropListBox8) 'Account Name
UserChoice(8)= ListOfColumns(dlg.DropListBox9) 'Details
        UserChoice(9)= ListOfColumns(dlg.DropListBox10) 'FS Category
        UserChoice(10)= ListOfColumns(dlg.DropListBox11) 'FS Type
UserChoice(11)= ListOfColumns(dlg.DropListBox12) 'Reviewer ID
UserChoice(12)= ListOfColumns(dlg.DropListBox13) 'Manual Journal Ref
I have now converted it into the array with the use of loop:
For i = 0 To 12
UserChoice (i) = " & ListOfColumns(dlg.DropListBox & i & ) & "
Next i
Which should display the value for each of 13 DropListBox but i having a problem to convert the line :
" & ListOfColumns(dlg.DropListBox & i & ) & " into ListOfColumns(dlg.DropListBox(i) )
Any idea how can I manipulate that bit please.
Regards
 

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Pawelski_33, try the following:

For i = 0 to 12

    UserChoice(i) = ListOfColumns(dlg.DropListBox & i)

next i

I haven't tested it out but I think it should work.

Pawelski_33
Offline
Joined: 06/05/2018 - 12:16

I tried that option before (and many others) and unfortunately they all failed.
 

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Pawelski_33,

I am just remembering that for this you have to list each one, there is no way that I know of to get around this.

Brian