Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Dynamically named DTCs

Dynamically named DTCs

Dynamically named DTCs

I've got two DTCs on my page. Ones a textbox the others a listbox. I want them to be dynamically named so I use the code below:
IF i = 1 THEN
txtSkillID.name = txtSkillID.name & i
txtSkillID.id = txtSkillID.id & i
txtSkillID.value = SkillsRS.Fields("SkillID").Value
txtSkillID.name = "txtSkillID" & (i)
txtSkillID.id = "txtSkillID" & (i)
txtSkillID.value = SkillsRS.Fields("SkillID").Value

But i'm stuck on how to call them. At the moment i'm using:

IndScore = (("lsbScore" & i).getText(("lsbScore" & i).selectedIndex))

but i get:

Microsoft VBScript runtime error '800a01a8'

Object required: '[string: "lsbScore1"]'

when I try to run the code. Anyone any ideas where i'm going wrong?

"Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway" - Jim Davis (Garfield)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close