specific cast is not valid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I am trying to access a dropdown control in a table and am using the code
below but get the error specific cast is not valid.
Dim ctrl_dpn1 As DropDownList
ctrl_dpn1 = CType(Me.Table1.FindControl("lst_bx_dest"), DropDownList)
just wondering if anyone has any ideas, thanks.
 
I'm guessing your DropDownList control is repeated in rows within the table,
am I correct?

If this is so, then your problem is simple... your FindControl method can't
grab just one DropDownList, so your CType operation can't work.

I've run into this myself, so if this is your problem, let me know and I'll
explain here in the group what I did to solve this conundrum.
 
Hi thanks for the response. Unfortunately I lost the file I was working on so
will have to start over, did not think I had a duplication in a row but not
sure.

--
Paul G
Software engineer.


Random said:
I'm guessing your DropDownList control is repeated in rows within the table,
am I correct?

If this is so, then your problem is simple... your FindControl method can't
grab just one DropDownList, so your CType operation can't work.

I've run into this myself, so if this is your problem, let me know and I'll
explain here in the group what I did to solve this conundrum.
 

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

Back
Top