I have a form where Client Info will be displayed. What I did is I created a user control with a bunch of textboxes lined up next to each other for Fname, Lname, Dob, SSN, etc. On the form itself, I created a copy of the user control but with labels to display the information that I'll in the USER CONTROL itself. So on FORM_LOAD, I'm pulling data from the server and I need it to add just as many USER controls as I have Clients in the database. The problem I'm seeing is, each time I add a control with this statement
Dim myCtl As Control
Set myCtl = Controls.Add("Project1.UCclient", "MyCtl", frmClientUC)
myCtl.Visible = True
....the user controls name gets incremented by one. So the first one I added on the form is ucclient1, then if i add another its ucclient2 and so on. Additionally, i loaded one of the USER CONTROLS with data (just to make sure it worked), I had to specify which ucclient I was referencing. So for the first one that I loaded I SELECTED data from SQL-SERVER then did this...
ucclient1.fldFirstName =RS!FirstName
ucclient1.fldLastName = RS!LastName
...and so forth for all the other fields. Because I have to specify what user control form I'm putting the data into, is there a way for it to increment it by itself? Possibly looping? I'm a newbie in VB6 and I'm just having a difficult time makign this work harmoniously without a 1000 lines of code.