plusone3055
asked on
Conversion type error
Greetings Experts,
Not sure where I went wrong here. I thought my code was pretty solid. My records are adding to my collection but they are not displaying on my main form. I get my catch error on line 107 (frmMain)
and lines 120 & 120 (frmMain)are givine me conversion type errors..
Conversion from string "" to type 'Integer' is not valid.
Conversion from string "" to type 'Decimal' is not valid.
Yet im not converting either they were declared respectivly in their classes as INteger and decimal.
PLease advise
classes and forms attached
CustomerClass.txt
PersonClass.txt
PreferredCustomerClass.txt
CustomerInformationModule.txt
frmAdd.txt
frmMain.txt
Not sure where I went wrong here. I thought my code was pretty solid. My records are adding to my collection but they are not displaying on my main form. I get my catch error on line 107 (frmMain)
and lines 120 & 120 (frmMain)are givine me conversion type errors..
Conversion from string "" to type 'Integer' is not valid.
Conversion from string "" to type 'Decimal' is not valid.
Yet im not converting either they were declared respectivly in their classes as INteger and decimal.
PLease advise
classes and forms attached
CustomerClass.txt
PersonClass.txt
PreferredCustomerClass.txt
CustomerInformationModule.txt
frmAdd.txt
frmMain.txt
What is the value of txtCustNumber.Text when the error occurs?
I think Thomasian has a good point... If you want to display data you should be getting the data from your PreferredCustomer class and displaying it in the textboxes.
Try that out and let us know.
Try that out and let us know.
ASKER
i reversed it and then it says
Colleciton index must be in the range 1 to the size of hte colleciton
the value i used was 1001
also when i reversed that
it autogenreated
txtcustnumber.text = CStr(pc.customerID)
Colleciton index must be in the range 1 to the size of hte colleciton
the value i used was 1001
also when i reversed that
it autogenreated
txtcustnumber.text = CStr(pc.customerID)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>Colleciton index must be in the range 1 to the size of hte colleciton
On which code did the error point to?
On which code did the error point to?
ASKER
changed from interer to string
Open in new window
Since the sub is named "DisplayData", I believe you want to show the data in the textbox. If so, that should beOpen in new window