emulate shrink and Grow fro a filed I have in a form (1 Viewer)

atrium

Registered User.
Local time
Today, 23:31
Joined
May 13, 2014
Messages
348
I need to use a form I also want to write the vba that will shrink and grow the field size to accommodate the incoming field data.
This is a continuous form and If I do it On Current It happens for the first one and then only if you click on each record.

I just can't seem to get it working for each record / row
 

Micron

AWF VIP
Local time
Today, 09:31
Joined
Oct 20, 2018
Messages
3,478
AFAIK, this is a losing proposition for a continuous form. For a form, can grow will only work for printed forms (which usually isn't done). If in vba you could calculate the needed height based on the number of characters in any particular record, I'm pretty sure it would affect all of the controls on every record. That's the nature of a continuous form unless conditional formatting is being used. I'm pretty sure CF doesn't provide for changing control dimensions.
 
Last edited:

vba_php

Forum Troll
Local time
Today, 08:31
Joined
Oct 6, 2019
Messages
2,880
If I do it On Current It happens for the first one and then only if you click on each record.

I just can't seem to get it working for each record / row
That makes perfect sense. Even though a continuous form technically displays multiple records on the screen at the same time, there is only 1 record active at a time. I'm guessing what you want is impossible. Unless of course, each time you added data to your table, you opened the form in design view using VBA, modified the width of each control you want to change, save the form then close it. You can certainly do that, although it's not normal.


this might provide some insight:


https://access-programmers.co.uk/forums/showpost.php?p=464624&postcount=8


but on the flip side, Peter seems to say that what you want *is* possible:


https://access-programmers.co.uk/forums/showpost.php?p=465074&postcount=11
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:31
Joined
Oct 29, 2018
Messages
21,454
Hi. As Micron said, I'm not sure you'll find a satisfactory answer to your question. I wonder what purpose it is for.
 

Users who are viewing this thread

Top Bottom