combo box issue
-
Dear All, Usage: access 2007, VBA I have 2 comboboxes, cbo1 and cbo2 , cbo1 is loaded with numbers from the database, and cbo2 is loaded with text from the database. dim cb1 as double dim cb2 as string cb1 = CDbl(me.cbo1.value) ' i chossed: 800524 cb2 = CStr (me.cbo2.value) ' i choosed: Hello World msgbox cb1 msgbox cb2 Result : 800524 Result : 4 where 4 represent the location of the "Hello world" , fourth element in the cb2, while i need to get the text :( I can get wat i need from this result (using dataset , and query) but it cost code lines and memory resource, shouldent .Value returns the exact value that is selected ???
0 will always beats the 1.
-
Dear All, Usage: access 2007, VBA I have 2 comboboxes, cbo1 and cbo2 , cbo1 is loaded with numbers from the database, and cbo2 is loaded with text from the database. dim cb1 as double dim cb2 as string cb1 = CDbl(me.cbo1.value) ' i chossed: 800524 cb2 = CStr (me.cbo2.value) ' i choosed: Hello World msgbox cb1 msgbox cb2 Result : 800524 Result : 4 where 4 represent the location of the "Hello world" , fourth element in the cb2, while i need to get the text :( I can get wat i need from this result (using dataset , and query) but it cost code lines and memory resource, shouldent .Value returns the exact value that is selected ???
0 will always beats the 1.
cb2 = CStr (me.cbo2.text)