Solved Shrink control on report

Gasman

Enthusiastic Amateur
Local time
Today, 01:40
Joined
Sep 21, 2011
Messages
15,440
I have to keep a log of my blood pressure for a while, so I created a simple report.
I added a comment field in the table, just for that reason.

However if nothing is in that field, I expected by setting Can Grow and Can Shrink to Yes, that I would not see that if nothing was in that field for that control?
However I still see the control, even when empty?

I tried setting it to next to nothing (0.01) in height and expecting it to grow when it has some data in it, but it stayed at that height?

So what am I missing please?

As 0.5 height
1727730948437.png


Reduced to 0.01 height
1727731023740.png
 
Not sure or can't remember exactly why those properties are available in a form, but I remember them working on reports only.

PS. If I remember it correctly, I think it only works in forms when you print the form.
 
Can shrink won't work if any controls overlap.
Post a picture of the form in design view and we might be able to see the issue.
 
The label control “Comment:” does not shrink with the text box. You can change the label to a text box and set its control source to:
="Comment: "+[Comment Field]
Set this new text box to can shrink. Using the + will make the entire expression null in the field is null.
 
I have to keep a log of my blood pressure for a while, so I created a simple report.
You mention a "simple report" but your screenshots appear to show a form.

For forms the CanGrow/-Shrink properties only have an effect if the form is printed.
 
That is it people.
Sorry, I was being a dumbass, it is a form not a report. :mad:

@DHookom will that work for a form at all? Prevalent opinion is those properties do not work for forms.

Why I thought I was using a report is beyond me. I know I am getting old, but still.... :(
 
I have to keep a log of my blood pressure for a while, so I created a simple report.
I added a comment field in the table, just for that reason.

However if nothing is in that field, I expected by setting Can Grow and Can Shrink to Yes, that I would not see that if nothing was in that field for that control?
However I still see the control, even when empty?

I tried setting it to next to nothing (0.01) in height and expecting it to grow when it has some data in it, but it stayed at that height?

So what am I missing please?

As 0.5 height
View attachment 116267

Reduced to 0.01 height
View attachment 116268
Good luck dealing with your blood pressure. A lot of us are in the same boat. I have found that daily tracking is a good way to maintain motivation to keep doing the things necessary to achieve success. My records go back 9 years now.

As an aside, I have observed that a consistent time, location and seated position are really important to getting reliable results.

With regard to the "report" aspect, as others have noted, Reports are usually the best tool for reporting when you need to manipulate the output. Try creating a report, therefore, that displays the data as you want to show it, rather than fuss over a form, which is not intended for reporting anyway. Or, even better, look into a reporting tool, like PowerBI, which is designed and built for just this kind of task.

1727783033746.png
 
You can write code to shrink a control (i.e. resize it) but only works on single forms. Typically the code would be called from the current event. You might have more code to expand it when it has the focus

In some situations, using a sub report on your form may be a solution
 
Good luck dealing with your blood pressure. A lot of us are in the same boat. I have found that daily tracking is a good way to maintain motivation to keep doing the things necessary to achieve success. My records go back 9 years now.

As an aside, I have observed that a consistent time, location and seated position are really important to getting reliable results.

With regard to the "report" aspect, as others have noted, Reports are usually the best tool for reporting when you need to manipulate the output. Try creating a report, therefore, that displays the data as you want to show it, rather than fuss over a form, which is not intended for reporting anyway. Or, even better, look into a reporting tool, like PowerBI, which is designed and built for just this kind of task.

View attachment 116281
Thank you @GPGeorge
Your BP is way better than mine?
I am taking readings in the same spot, but often forget. Last Friday I was up at 0700 and only remembered to do it at 0925. :)

Is there any chance I could get a copy of that report you show there please?, or is that the PowerBI report?
 
@Gasman Here's a database I've been adding to for almost 20 years now. I started it for my husband to track his diabetes meds. Then I added to it for other family members. They all love it.

I like George's report. Maybe I'll look into creating some graphs.
 

Attachments

Users who are viewing this thread

Back
Top Bottom