Here's a trick I need to do:
I am writing a program that will print a string of three characters everytime I select something from a combobox. And I get frustrated, cause it does not work. Here's the code and the file I am using:
Code:
'get the states list
Set mFstate = mFSO.GetFile("c:\states.txt")
Set mTstate = mFstate.OpenAsTextStream(ForReading)
'string and integer declaration for the event combo box
Dim strevent As String, indevent As Integer, nextevent(53, 2) As String
Dim i As Integer, j As Integer
'load the event list
cmb_event.Clear
strevent = mTevent.ReadAll
indevent = InStr(1, strevent, ",")
i = 0
While indevent <> 0 And i < 53
j = 0
nextevent(i, j) = Left$(strevent, indevent - 1)
j = 1
strevent = Right$(strevent, Len(strevent) - indevent)
indevent = InStr(1, strevent, ",")
nextevent(i, j) = Left$(strevent, indevent - 1)
strevent = Right$(strevent, Len(strevent) - indevent)
indevent = InStr(1, strevent, ",")
cmb_event.AddItem (nextevent(i, 0))
cmb_eventcode.AddItem (nextevent(i, 1))
i = i + 1
Wend
Now, everything I tried in order to get it printed, or stored in a variable (dim eve as string), it did not work. So what I want is that whenever the user selects something from the combobox, the appropriate 3 character string to be stored in that eve variable.
Please help!
Private Sub cmb_event_Click()
Eve = Eve &" " & cmb_eventcode.list(cmb_event.ListIndex)
End Sub
with this code everytime a item is selected in Cmb_Event the relevant code in Cmb_eventcode will be added to the Eve string, with a space between each.
Note: Eve must be defined at a global level (Under the Definitions area of your form).
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.