Auto Grow text box horizontally based on content (1 Viewer)

alvingenius

IT Specialist
Local time
Today, 15:01
Joined
Jul 10, 2016
Messages
169
Hello Fam,
i know about format property ( Can grow / Can shrink )
and Can grow is good but it only grow vertically while i need to grow horizontally

like i have 2 text boxes lets say First Name and Last Name
and i put them in stacked layout horizontally

Width for both boxes = 1"



if we preview it, it will look like this


and that's not accepted look, while it should be like this :



therefore,
is there any way to auto width the text boxes based on the content inside in reports ?

Thanks ,
 

Attachments

  • 1.PNG
    1.PNG
    2 KB · Views: 648
  • 2.PNG
    2.PNG
    852 bytes · Views: 641
  • 3.PNG
    3.PNG
    970 bytes · Views: 493

theDBguy

I’m here to help
Staff member
Local time
Today, 06:01
Joined
Oct 29, 2018
Messages
21,357
Hi. How about just concatenating the two fields into one?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:01
Joined
May 7, 2009
Messages
19,169
or the first textbox, Text Alignment=Right
 

alvingenius

IT Specialist
Local time
Today, 15:01
Joined
Jul 10, 2016
Messages
169
or the first textbox, Text Alignment=Right

:):):):):):):):):)
i wanted a solution that will work on all cases

my real report is Full NAME - Job Title - Country all in one row

and the
Full name text box Width = 2'
Job Title Width = 2'
Country Width = 2'

it appears in not good look if the country name is small or job title is small even if i put em in left or right align
 

alvingenius

IT Specialist
Local time
Today, 15:01
Joined
Jul 10, 2016
Messages
169
why we are going away from my question to a side questions ? and a manipulation stuff ?
why there's no answer about is there a Code for auto grow width?
and i've searched and found this

http://www.lebans.com/autosize_textbox.htm

many thanks for your efforts trying to do that with the very very very easy way
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 13:01
Joined
Jul 9, 2003
Messages
16,244
why we are going away from my question to a side questions ? and a manipulation stuff ?

why there's no answer about is there a Code for auto grow width?

Because concatenation may well be the easiest and best solution to your problem.


Sent from Newbury UK
 

alvingenius

IT Specialist
Local time
Today, 15:01
Joined
Jul 10, 2016
Messages
169
Because concatenation may well be the easiest and best solution to your problem.


Sent from Newbury UK

well, it will work, and i said it's not possible because every report have about 15 dlookups and i'will have to merge em every 3 controls into 1 and i will need to add separators like &"/"& and it will take a huge time from me to edit every text box !!

that's why i wanted a code to do that for me ! in matter of seconds
 

alvingenius

IT Specialist
Local time
Today, 15:01
Joined
Jul 10, 2016
Messages
169
There is no 'can grow/shrink horizontal' property and controlling this with code would be a nightmare, especially if using a proportional font where characters aren't all same width. How would you know how wide to make control if there is no reliable unit of measure to calculate with?

I agree, concatenate or live with white space.

it seems that's my only solutions for now
Thanks @June7
 

June7

AWF VIP
Local time
Today, 05:01
Joined
Mar 9, 2014
Messages
5,423
Apparently you read my post before I deleted it. I saw your post about Lebans example after I posted. Looks like that does sort of offer a solution - with a bunch of code. Is it worthwhile? Only you can decide.

Keep in mind that programmatically setting control property on form affects ALL instances of control. So if form is in Continuous view, all instances of control will show width coded by current record.

On a report, have to use Format or Print event in which case code only triggers for direct to printer or PrintPreview, not ReportView.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 13:01
Joined
Jul 9, 2003
Messages
16,244
i'will have to merge em every 3 controls into 1 and i will need to add separators like &"/"& and it will take a huge time from me to edit every text box !!

Well I wouldn't do it like that, I would create a query that concatenates the information together and then I would create a report based on that query.



Sent from Newbury UK
 

Users who are viewing this thread

Top Bottom