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

Scoreboard - Dynamic object names for Data Entry

P: 1
Creating a Scoreboard in VB 2013 but having issues with the final aspect of scoring the innings.

I've got an Inning field (IE Inning 1 thru 7) and an Inning Status (ie Top, Mid, Bot).

Based on the status of these 2 fields, I've got 2 buttons that it will add or subtract to the run count for the proper teams but my issue is that I can't seem to figure out how to create the proper object names based on the Inning and Status field to add the run totals.

My object text box names are basic names of I1H, I1V thru to I7H, I7V.

Any help is greatly appreciated.... also just starting programming again in VB. Haven't done so since 2000.

Expand|Select|Wrap|Line Numbers
  1. If InningBox.Text = "1" And StatusCB.Text = "Top" Then
  2.             I1V.Text = "0"
  3.         ElseIf InningBox.Text = "1" And StatusCB.Text = "Bot" Then
  4.             I1H.Text = "0"
  5.         ElseIf InningBox.Text = "2" And StatusCB.Text = "Top" Then
  6.             I2V.Text = "0"
  7.         ElseIf InningBox.Text = "2" And StatusCB.Text = "Bot" Then
  8.             I2H.Text = "0"
  9.         ElseIf InningBox.Text = "3" And StatusCB.Text = "Top" Then
  10.             I3V.Text = "0"
  11.         ElseIf InningBox.Text = "3" And StatusCB.Text = "Bot" Then
  12.             I3H.Text = "0"
  13.         ElseIf InningBox.Text = "4" And StatusCB.Text = "Top" Then
  14.             I4V.Text = "0"
  15.         ElseIf InningBox.Text = "4" And StatusCB.Text = "Bot" Then
  16.             I4H.Text = "0"
  17.         ElseIf InningBox.Text = "5" And StatusCB.Text = "Top" Then
  18.             I5V.Text = "0"
  19.         ElseIf InningBox.Text = "5" And StatusCB.Text = "Bot" Then
  20.             I5H.Text = "0"
  21.         ElseIf InningBox.Text = "6" And StatusCB.Text = "Top" Then
  22.             I6V.Text = "0"
  23.         ElseIf InningBox.Text = "6" And StatusCB.Text = "Bot" Then
  24.             I6H.Text = "0"
  25.         ElseIf InningBox.Text = "7" And StatusCB.Text = "Top" Then
  26.             I7V.Text = "0"
  27.         ElseIf InningBox.Text = "7" And StatusCB.Text = "Bot" Then
  28.             I7H.Text = "0"
  29.         End If
Aug 14 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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