Multiple labels could be change with on go. (1 Viewer)

Samadkhan

Registered User.
Local time
Tomorrow, 01:36
Joined
Sep 23, 2018
Messages
31
Hey All,

I am trying to create several forms where I will place Title (lable) company name.

Is is possible in access 2013, if I change somewhere the name of company and it should change all labels with the same company name?

If is it possible please let me have the solution how may I apply this.

Thanks you very much.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:36
Joined
Feb 19, 2013
Messages
16,609
not clear what you are asking - but sounds like you should be using a bound text box to show the company name, not a label.

If this is not the answer, you will need to provide more information - change the name of the company where? how is it stored?

if you are talking about a design change then you will need vba to loop through all forms and reports and for each of these loop through all the controls and where it is a label, compare the caption property.

Alternatively, you might just be able to change the caption property of a field in a table somewhere

As I said, you need to be much clearer about your requirement
 

isladogs

MVP / VIP
Local time
Today, 22:36
Joined
Jan 14, 2017
Messages
18,217
Save the company name in a table.
Create a public function GetCompanyName in a standard module to read that value.
Use the function in each label caption instead of hard coding the name.

It will then automatically update the labels if another company name is used later
 

Samadkhan

Registered User.
Local time
Tomorrow, 01:36
Joined
Sep 23, 2018
Messages
31
Thank you very much CJ_London for your swift response, highly appreciated...

I have created the tblUser, In this table I have created the field UserNme (Company Name).

Then I created a form with the lblCompanyName (Lable).

I am a beginner, if possible please help me and specify the Public functions GetCompanyName code with bundles of thanks.

Thank you



Save the company name in a table.
Create a public function GetCompanyName in a standard module to read that value.
Use the function in each label caption instead of hard coding the name.

It will then automatically update the labels if another company name is used later
 

Samadkhan

Registered User.
Local time
Tomorrow, 01:36
Joined
Sep 23, 2018
Messages
31
Thank you very much CJ_London got my issue resolved...

Thank you millions much ... have a wonderful day ..!!!
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:36
Joined
Feb 19, 2013
Messages
16,609
Then I created a form with the lblCompanyName (Lable).
for my suggestion, create a textbox, not a label. You can delete the associated label control

Assuming this is a one record table in the textbox controlsource put

=dlookup("CompanyName","tblUser")

you may also want to set the textbox Locked property to Yes
 

isladogs

MVP / VIP
Local time
Today, 22:36
Joined
Jan 14, 2017
Messages
18,217
You keep referring to CJ_London but quoted my post and function idea.
As you have indicated it's now solved, there seems no point in explaining further.
Cheers!
 

Samadkhan

Registered User.
Local time
Tomorrow, 01:36
Joined
Sep 23, 2018
Messages
31
Dear Ridders,

Please accept my sincere apology, I am new and don't know much about this forum now I am learning .... Hope you may understand .


Thanks

You keep referring to CJ_London but quoted my post and function idea.
As you have indicated it's now solved, there seems no point in explaining further.
Cheers!
 

isladogs

MVP / VIP
Local time
Today, 22:36
Joined
Jan 14, 2017
Messages
18,217
I'm not offended and hopefully neither is CJ London....but it did make it hard knowing whether to reply or not :D
 

Users who are viewing this thread

Top Bottom