ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Just another error message (https://www.excelbanter.com/excel-programming/331830-just-another-error-message.html)

Jennifer

Just another error message
 
I need some attention!
Bug says "invalid use of null"
Private Sub ShowValue(cbo As ComboBox)
If cbo.ListIndex = -1 Then Exit Sub
lblShow.Caption = cbo.Value ***************
End Sub


*****this is highlighted area.
When I choose from a combo box in a form i have, I would liek to choose and
id and in a label it show the name for the id. The cbo works fine if I only
have 1 bound column but i need it to have 2 in order to show the correct name
in the label. THis is when I run into this error. Thank you so much, Jennifer
--
Though daily learning, I LOVE EXCEL!
Jennifer

mangesh_yadav[_321_]

Just another error message
 

for column 1
cbo.List(cbo.ListIndex, 1)

for column 2
cbo.List(cbo.ListIndex, 2)

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=379265


Jennifer

Just another error message
 
Sorry, i guess i need more help than that. Were do i put that? Thank you for
all your help.
--
Though daily learning, I LOVE EXCEL!
Jennifer


"mangesh_yadav" wrote:


for column 1
cbo.List(cbo.ListIndex, 1)

for column 2
cbo.List(cbo.ListIndex, 2)

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=379265



mangesh_yadav[_322_]

Just another error message
 

I guess this is what you need.

lblShow.Caption = cbo.List(cbo.ListIndex, 1) & " "
cbo.List(cbo.ListIndex, 2)

Manges

--
mangesh_yada
-----------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047
View this thread: http://www.excelforum.com/showthread.php?threadid=37926



All times are GMT +1. The time now is 08:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com