|
-
Jul 28th, 2005, 12:19 PM
#1
Thread Starter
New Member
Is it possible to insert variable names into similar textbox names?
I understand the basics of programming from doing some programming in college years ago in a not so popular language (FORTRAN). Recently started toying with VB to make some excel files more useful but, I've only learned what I've needed to from the program's help so I barely know any of the fun stuff that can be done with VB.
Enough of that, here is what I am trying to figure out:
I am trying to fill a number of text boxes with data calculated elsewhere in the program. There are say three sets of text boxes and each set has similiar names to the others with one part different.
For example:
TextBoxVendor2ImpInst
TextBoxVendor2ImpWir
TextBoxVendor2IncWork
Where "Vendor2" changes to "Vendor3" etc.
Instead of setting the value for each textbox for each vendor separate times I was hoping to be able to have a procedure do it for me. My problem is I don't know how to insert a variable into a textbox name so that it can be changed from one vendor to the next.
Sample of code I initially tried. But obviously VB looks for a text box name with Company in it and that doesn't exist. I tried a number of ways to have Company be a variable within the textbox name with zero success. Is it even possible or do I have to leave it the way I currently have it set up?
Breakdownboxes ("Vendor1")
Private Sub Breakdownboxes(Company)
BreakdownForm.TextBoxCompanyImpInst.Text = 0
BreakdownForm.TextBoxCompanyImpWir.Text = 0
BreakdownForm.TextBoxCompanyIncWork.Text = 0
BreakdownForm.TextBoxCompanyMFGDam.Text = 0
BreakdownForm.TextBoxCompanyFailComp.Text = 0
BreakdownForm.TextBoxCompanyDwgErr.Text = 0
BreakdownForm.TextBoxCompanyDesChg.Text = 0
BreakdownForm.TextBoxCompanyDesErr.Text = 0
End Sub
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|