Ok, here it goes. I am trying to develope a report that pulls out my states from the table. Now earlier I posted code that shows how to extract them and put each state into numbers. Now I need to convert the numbers into the lettered states. Should I set up an array and then some kind of loop to do this or is there a different way? Just in case here is the code that extracts the numbers from my form and puts it into a field for storage.
Private Sub Form_Current()
Dim intMyNum, arrMyList
For i = 0 To (lstStates.ListCount – 1)
lstStates.Selected(i) = False
Next i
If txtStates “” Then
arrMyList = Split(txtStates, “*”)
For j = 0 To UBound(arrMyList)
If IsNumeric(arrMyList(j)) Then
intMyNum = CInt(arrMyList(j))
lstStates.Selected(intMyNum) = True
End If
Next j
End If
End Sub
Private Sub lstStates_Click()
txtStates = Null
For i = 0 To (lstStates.ItemsSelected.Count – 1)
txtStates = txtStates & lstStates.ItemsSelected.Item(i) & “*”
Next i
If Len(txtStates) > 0 Then
txtStates = Left(txtStates, (Len(txtStates) – 1))
End If
End Sub