Hi there, i need help in putting a listbox selection into a string. Ive tryed it may ways, and keep getting, "invalid use of null"
i have 4 global variables
2 listboxes with 2 columns each, each listbox is bound to column 1, and only lists column 2, using the 0",1" trick.
heres my code, inside of the button click event:
dim catChoice as integer
dim manuChoice as integer
dim catString as string
dim manuString as string
----------cmdGetChoice_Click event-----------
If Me.lstManuPicker.Value = 0 Then ' deal with no choices
MsgBox "Please Choose a Manufacturer", vbOKOnly, "Form Error"
ElseIf Me.lstCatPicker.Value = 0 Then
MsgBox "Please Choose a Stock Category", vbOKOnly, "Form Error"
Else
manuChoice = Me.lstManuPicker.Value ' get manufacturer integer choice
catChoice = Me.lstCatPicker.Value ' get category integer choice
manuString = Me.lstManuPicker.Column(2, manuChoice) ' get manufacturer text from list box
catString = Me.lstCatPicker.Column(2, catChoice) ' get category text from list box
[Forms]![frmStock]![txtManuName]![Text] = manuString ' put text into target from
[Forms]![frmStock]![txtStockCatName]![Text] = catString ' put text into target from
End If
----------------
any ideas ??
i would just bind the strings to column 2 of the listboxes, but i need the bound column data elsewhere.
Thanx for any and all help
regards
h3lm3t
i have 4 global variables
2 listboxes with 2 columns each, each listbox is bound to column 1, and only lists column 2, using the 0",1" trick.
heres my code, inside of the button click event:
dim catChoice as integer
dim manuChoice as integer
dim catString as string
dim manuString as string
----------cmdGetChoice_Click event-----------
If Me.lstManuPicker.Value = 0 Then ' deal with no choices
MsgBox "Please Choose a Manufacturer", vbOKOnly, "Form Error"
ElseIf Me.lstCatPicker.Value = 0 Then
MsgBox "Please Choose a Stock Category", vbOKOnly, "Form Error"
Else
manuChoice = Me.lstManuPicker.Value ' get manufacturer integer choice
catChoice = Me.lstCatPicker.Value ' get category integer choice
manuString = Me.lstManuPicker.Column(2, manuChoice) ' get manufacturer text from list box
catString = Me.lstCatPicker.Column(2, catChoice) ' get category text from list box
[Forms]![frmStock]![txtManuName]![Text] = manuString ' put text into target from
[Forms]![frmStock]![txtStockCatName]![Text] = catString ' put text into target from
End If
----------------
any ideas ??
i would just bind the strings to column 2 of the listboxes, but i need the bound column data elsewhere.
Thanx for any and all help
regards
h3lm3t