Object reference not set to an instance of an object.

J

Jacky

Hi,

I get the eror "Object reference not set to an instance of
an object" when i paste this line of code "
Me.DDCompCode.Items.FindByValue(e.Item.Cells
(1).Text).Selected = True "
..

Can someone help me out?

Thanks.

Jacky
 
K

Ken Schaefer

You'd get this error if there is no value in DDCompCode that matches
e.Item.Cells (1).Text

You could try checking to see if

Me.DDCompCode.Items.FindByValue(e.Item.Cells (1).Text) Is Not Nothing

before attempting to set it as the selected value

Cheers
Ken

: Hi,
:
: I get the eror "Object reference not set to an instance of
: an object" when i paste this line of code "
: Me.DDCompCode.Items.FindByValue(e.Item.Cells
: (1).Text).Selected = True "
: .
:
: Can someone help me out?
:
: Thanks.
:
: Jacky
:
:
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top