GiraffetheGeek
Board Regular
- Joined
- May 25, 2011
- Messages
- 58
I have a user form that has 80 text boxes and 20 control buttons that have similar names that vary with numbers.
ie WB_TxtBox_NameWeek1Appt1, and WB_TxtBox_NameWeek1Appt2 etc
ie Btn_Week1Appt1, Btn_Week1Appt2, Btn_Week2Appt1 etc.
I want to be able to use a varible when making references to these object in code,
ie Having a WeekCount varible and then instead of
I tried to use
This obviously didn't work as the syntax is wrong.
Can someone let me know what the correct syntax is?
ie WB_TxtBox_NameWeek1Appt1, and WB_TxtBox_NameWeek1Appt2 etc
ie Btn_Week1Appt1, Btn_Week1Appt2, Btn_Week2Appt1 etc.
I want to be able to use a varible when making references to these object in code,
ie Having a WeekCount varible and then instead of
Code:
WB_TxtBox_NameWeek1Appt1.Text
I tried to use
Code:
WeekCount = 1
ApptCount =1
WB_TextBox_NameWeek & WeekCount & Appt & ApptCount.Text
This obviously didn't work as the syntax is wrong.
Can someone let me know what the correct syntax is?