Text Box between labels (1 Viewer)

gsrajan

Registered User.
Local time
Today, 19:44
Joined
Apr 22, 2014
Messages
227
Hi, I am placing bound text box between two labels. How to adjust the width of the text box dynamically based on the length of data in the text box. Can shrink or can grow property is not helpful. Please help. Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:44
Joined
Oct 29, 2018
Messages
21,358
On a Form? You can try to use code, but that means you'll also have to adjust the position of all the other controls to avoid overlaps. I suggest that design your Textbox to as wide or tall enough to fit as much data as possible rather than deal with the headache of getting the code right. When the content is too big for the control, you should see a scrollbar.
 

gsrajan

Registered User.
Local time
Today, 19:44
Joined
Apr 22, 2014
Messages
227
Thank you, not form, but report.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:44
Joined
Oct 29, 2018
Messages
21,358
Thank you, not form, but report.
Okay, on Reports, growing is only vertical, not horizontal. Also, on reports, you're limited to the paper size plus margins. So, using code to widen a Textbox, you'll also need to worry about how far you've gone while also considering the size of all the other controls to the right and make sure they don't drop off. So, again, I suggest just designing the report to have controls to have as wide enough size to contain as much data as possible. You can then use Can Grow to show additional data below the first row of data.
 

gsrajan

Registered User.
Local time
Today, 19:44
Joined
Apr 22, 2014
Messages
227
Ok, thanks. Then I will try mail merge, not sure if it will work, never done. Thank you.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:44
Joined
Oct 29, 2018
Messages
21,358
Ok, thanks. Then I will try mail merge, not sure if it will work, never done. Thank you.
There is a very easy and simple mail merge template available online. It might make your life easier.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 16:44
Joined
Aug 30, 2003
Messages
36,118
If my guess at what you're doing is correct, you can mix fixed text (your labels) and data (your textbox). Try a textbox with a control source like:

="the text from the first label" & [Fieldname] & "text from the second label"

where Fieldname is the field you currently have in the textbox (its control source).
 

gsrajan

Registered User.
Local time
Today, 19:44
Joined
Apr 22, 2014
Messages
227
There is a very easy and simple mail merge template available online. It might make your life easier.
Thank you. If you know the link for the template, please let me know. Thank you.
 

gsrajan

Registered User.
Local time
Today, 19:44
Joined
Apr 22, 2014
Messages
227
If my guess at what you're doing is correct, you can mix fixed text (your labels) and data (your textbox). Try a textbox with a control source like:

="the text from the first label" & [Fieldname] & "text from the second label"

where Fieldname is the field you currently have in the textbox (its control source).
 

gsrajan

Registered User.
Local time
Today, 19:44
Joined
Apr 22, 2014
Messages
227
Hi pbaldy, Thank you, this is what I have been looking for. Thanks for your help. Have a good weekend.
 

Users who are viewing this thread

Top Bottom