Accessing textboxes from ascx control on parent page

M

mollyf

I have multiple user controls on a form. I have a save button on each
control so the users can save as they go and on the parent form, I have
another button which will save/update everything entered in on the user
controls. My problem is that I cannot access the different controls on
the user control. I changed the "protected" to "public" for each
textbox that I'm wanting to "see" in the parent form. In my parent
form, I have Protected WithEvents RecipInfo As ctrlRecipInfo (with
ctrlRecipInfo being the control I want to access). I can see each of
the textboxes in my parent form but when I execute the code, I get
"Object reference not set to an instance of an object." as soon as it
gets to RecipInfo.txtFName.Text.

Obviously RecipInfo isn't an instance of the object ctrlRecipInfo but I
have no idea of where and how to do that.

Thanks.

Molly J. Fagan
Oklahoma Foundation for Medical Quality
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top