Changing control Width on continuous form (1 Viewer)

Mark_

Longboard on the internet
Local time
Yesterday, 18:35
Joined
Sep 12, 2017
Messages
2,111
Greetings one and all.

I've run into an issue I hope others can illuminate me on; In a continuous form I can set a labels Caption with Me.[Label].Caption and I can read the controls width with Me.[Label].Width.

When I try Me.[Label].Width = Value, I get an error 2101 "The setting you entered isn't valid for this property" even when I know it is within range OR I am setting it to 0.

Is this a known issue on Continuous forms? Is there something odd I need to do? Is there another control I can resize on a continuous form?

Trying to make a Gantt type chart using a form/subform instead of a report. If ACCESS doesn't like changing control sized I may have another option, but I'd rather not delve into it if I can get this to behave.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 02:35
Joined
Jul 9, 2003
Messages
16,280
I can't test anything because I'm on a Chromebook.

However if the label is on a continuous form, and you do manage to change the label width, wouldn't that change the width of all the instances of the label? In other words, how would this be useful for a gantt chart?
 

missinglinq

AWF VIP
Local time
Yesterday, 21:35
Joined
Jun 20, 2003
Messages
6,423
I have no problem doing this in a Continuous Form.

Is this an independent Label, or one attached to another Control, such as a Textbox?

If the later, if a Ribbon was used to create the Form, rather than manually designing it (i.e. adding individual Controls to it, in Design View) the Controls will all be 'stacked' together, and adjusting the width of one Label will adjust the width of all the Labels.

As Uncle G stated, in a Continuous Form, the Controls' widths will be the same in all Records, not just the current one, if that matters to you.

Lastly, have you tried doing this on more than one Label? If not, you might try that. Although we usually think of Forms, or entire Databases, when we speak of corruption, individual Controls, such as Labels, can and do become corrupted. The test and the fix are one and the same; deleting the Control then re-creating it. If it was corrupt, you've verified the fact and solved the problem! If not, you've only lost a minute or two!

Linq ;0)>
 

Mark_

Longboard on the internet
Local time
Yesterday, 18:35
Joined
Sep 12, 2017
Messages
2,111
linq,
I removed the label, compact/repaired, and recreated.
I added new controls and I'm not able to set their width or left either.

Using Access 2013.

I was also hoping that, if I could have a unique caption for a label for each record I'd also be able to move it about. It did show some other issues that may prevent what I'm looking to do form working.

End goal, I'd love to be able to show a bar that is offset based on the date an action starts and has its length dictated by duration, effectively a GANTT chart. So far I've been able to find a (nominally useful) fixed space font and use it, but the results are less than what I'd wish for.

As I've already worked out how to do this as a report I'll stay with that... for now.

Oddly I've noticed that the "On Paint" seems to be fired more than once per record. This is very apparent when you change a filter as it seems to be fired prior to controls being available on a continuous form, an issue that causes errors as the controls seem not to exist yet when it first passes through after requery. This is only apparent when the number of instances of the form is less than the number that can be shown in a subform, at least that's so far where I've encountered it.
 

Users who are viewing this thread

Top Bottom