I almost have my handy-dandy replacement application ready to go, but I ran into a little problem – users like to see dropdown boxes with codes and descriptions (e.g. d dog), and the table to be added/updated just wants the code. Although I’ve been able to set up a listbox that contains the field:
“Select salescode + ‘ ‘ + Description as DropCode FROM T_Mickey ORDER BY salescode”
when I try to take the left three for the DropCode and I set it up like:
dim txtRegion as TextBox
dim strRegion as String
……..
txtRegion = lstSRep.SelectedItem
strRegion = Left(txtRegion.Text, 3)
I get….
“Value of type ‘System.Web.UI.WebControls.ListItem’ cannot be converted to ‘System.Web.UI.WebControls.TextBox’.”
If I set up:
strRegion = Left(lstSRep.SelectedItem, 3)
I get:
Value of type ‘System.Web.UI.WebControls.ListItem’ cannot be converted to ‘String’
So how do I get the left 3 of DropCode? I think I’m missing something here, right?