Program Exiting Procedure Before Completing Instructions

When I step thruought the code, the vb stepper lands right on instruction "frmForm.Add(f)" below.  When I press F8 again instead of it being executed and flowing down to the next instruction, it just exists out of the procedure.  I tried placing On error goto 0 before it and it did not help.  When I try to reference  frmForm(TabNumber) later in the program, it comes up empty.  Any suggestions?

Dims:   Public frmForm As List(Of PDF_ML_Form)
       
Procedure:
           Dim f As New PDF_ML_Form
           f.TabID = TabPages.Count
           frmForm.Add(f)
Other instructions
GarySBAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonMiddle School Assistant TeacherCommented:
Did you INSTANTIATE your "frmForm" List?

You have:

    Public frmForm As List(Of PDF_ML_Form)

You need to use the "New" keyword:

    Public frmForm As New List(Of PDF_ML_Form)

Or have you already done this via code somewhere else?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HainKurtSr. System AnalystCommented:
do you get any exception? or do you have any exception handler that calls your procedure?

maybe your code & compiled versions are different, try to clean up your project and rebuild before debugging...
0
GarySBAuthor Commented:
Thank You Idle_Mind The New keyword solved it.
I posed another question similar to this. Title 'How to update a List(Of...
I'm trying to simply update the entire frmForm() with the latest displayed data.  I'm using
BOMaterial.frmForm(TabPage) = BOMaterial.BOM_TabControl1.TabPages(TabPage).Container But it seems to save a single item (blank) instead of the entire form.  Is it possible for you to switch over to the other question?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.