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

the line that txtEmailAdd.Text is where I am getting hit with the error?

P: 1
I keep getting error updaterecord = Ctype txtEmailAdd line

Expand|Select|Wrap|Line Numbers
  1. Private Sub AddName_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  2.         Dim Email = txtEmailAdd.Text
  3.         Dim updaterecord As Record = New Record
  4.         updaterecord = CType(Inventory.Item(recordNumber), Record)
  5.         txtName.Text = updaterecord.Name
  6.         txtEmailAdd.Text = updaterecord.Email()
  7.         txtPhone.Text = updaterecord.Phone
  8.         txtNotes.Text = updaterecord.Notes
System.IndexOutOfRangeException: 'Collection index must be in the range 1 to the size of the collection.'
1 Week Ago #1
Share this Question
Share on Google+
1 Reply


zmbd
Expert Mod 5K+
P: 5,380
updaterecord = Ctype txtEmailAdd line
Is not in the code you posted (and is malformed as typed)
Basically the error is telling you "404 Not Found"
So something is missing in the information you've attempted to submit to the function - the item referenced isn't in the data you have on hand.

In the code you've posted
I don't recognize "record" as a valid data type in line4
5 Days Ago #2

Post your reply

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