Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I change label name but not lose code?

Status
Not open for further replies.

NeilT123

Technical User
Jan 6, 2005
302
GB
I have a form that uses labels as buttons. If I rename the label I lose the code behind the label.

Does anyone know if there is a way to change the name but keep the code?

Not sure if relevant but my Track Name AutoCorrect info box is ticked.

Thanks
 
Just go into the code window and change the name there to match your control's new name.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
I would turn AutoCorrect off, it causes nothing but problems. I quick search through these forums should confirm that.

I would add to misslinglinq's advice, that after doing a search & replace of the control's event procedures to change the name, you might need to "jump" to these procedures via the control's Properties box. I have found the events don't get "rewired" until you do this (don't ask me why).
 
Thanks for the info.

I have experienced some of the non "rewiring".
 
I have occassionally had the same problem, when a control was deleted,a new one created and given the exact same name as the deleted control. In order for the code to work you have to go into Properties and select the event then click on Code Builder, then simply exit the code editor. The odd thing is this isn't always necessary! Another Access quirk, I guess!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top