01-03-2008, 10:05 AM
i'm creating a multi-form application with VB6 using database, and in a form i have some text boxes. I am trying to name one of them "txtCustLastName" but the VB says " 'txtCustLastName' is a control name". I don't understand what it means. I have other text boxes named txtCustFirstName and txtCustID and i had no problem. Why it doesn't allow me to use that name?
01-03-2008, 10:33 AM
Can you upload your project or at least just your form please. I cant think what it is but maybe we might see something if we have a look
01-03-2008, 11:39 AM
here's a screenshot but I don't think it will help
there is no code yet, just the design and the names of the items. When I type "txtCustLastName" to the right (at the field (Name) which is hilighted in the screen shot) and press enter, i get the error you see!
01-03-2008, 11:48 AM
If VB says the name is already a control name then it probably is. Check and recheck all controls for their names. Are you misspelling anything?
01-03-2008, 11:49 AM
yea but what it means with "control"? text boxes, labels etc?
01-03-2008, 11:56 AM
A control is any control. Text boxes, Combo boxes, Labels, aanything you drag on the Form is a control.
You could start over and begin with the problem name and see what happens when you go to name the other controls
01-03-2008, 11:58 AM
It is a different control. If it was the same type of control then it would ask you to create an array instead
01-03-2008, 11:58 AM
duh...ok I found the problem...I named a label "txtCustLastName" instead of "lblCustLastName"...damm...I spent lot of time to find it...
thanks alot for your help guys!
edit: yea i thought to start it over and I made a last check before to that, but happily I found the problem :D
01-03-2008, 12:00 PM
For future reference you can use the combo box above the properties to find a name if you believe its already in use
01-03-2008, 12:01 PM
yea thanks for the tip! Simple tho but I didn't know it...I'm new in VB obviously :D
01-03-2008, 12:08 PM
It doesnt matter how new you are. Things like that happen. I frequently rename forms and controls when i mean to paste something somewhere