By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

How can I refer a label by concantenating its name property

P: 2
I have a problem in passing a text value of a label named lbl_hours_1 up to lbl_hours_32 in form frm_main to a label named lbl_swap_hours_1 up to lbl_swap_hours_32 in form frm_swap_room,it always shows an null reference error

this is the code I used, I put it in a Module named Mod_swap_room to be called on a button in frm_swap_room

Expand|Select|Wrap|Line Numbers
  1.             For x As Integer = 1 To 32
  2.             frm.controls("lbl_swap_hours_" & x).text = frm_main.Controls("lbl_hours_" & x).Text
  3.         Next x
May 3 '13 #1
Share this Question
Share on Google+
2 Replies

P: 2
I need to know the alternative codes because I will swap the value of each hours depending of the input of a two textboxes
May 3 '13 #2

Expert Mod 10K+
P: 12,382
And what problem are you having with that code? Are you getting error messages? What are they?
May 4 '13 #3

Post your reply

Sign in to post your reply or Sign up for a free account.