Programatically change control position

atom0007

New member
Local time
Today, 11:42
Joined
Oct 6, 2011
Messages
3
Hello world

I have a database table called "people" with a field called "location". There are hundreds of records in that table.

Example values in "location" would be:

bed
breakfast
car
work
lunch
shower

etc (PS, I am not big brother!)

I would like a very visual way of showing where all the people are, in chronological order, something like this:


Bed...............Shower.................Work
John
.....................Andrew
....................Timmy
.....................Jane
...................................................Mr Keen

Initially, I tried using continuous forms, and programmatically setting the "left" property of a bound text box on a per record basis, through the detail paint event.
This does not work (not sure why not yet)

The only other way I can think to do this is to programmatically create a text box per record in a blank form, and adjust the left property of that control according to the "location" value (by using a "choose" structure probably).

However, I have read that over a form's lifetime, it is limited to 754 controls, so this doesn't seem very scalable to me. I could create 700 at the start, then unhide as required, but it seems to run out of steam quite quickly.

Does anyone have any ideas? I have thought about a flexgrid control, or embedded spreadsheet. I have a feeling I am missing something....it feels like conditional formatting, but is really conditional positioning.

Hope my example is clear - it is really about tracking products chronologically through a production line
 
I cannot, for the life of me, understand what you're trying to do here. This is probably a failing on my part, but I can tell you, when you're talking about Continuous View or Datasheet View Forms, the only formatting on a Record-by-Record basis that you can do has to be done through Conditional Formatting. And Conditional Formatting does not allow for changing the size or positioning of Controls.

Your posted example, by the way, does indeed look more like you're talking about a spreadsheet than a relational database.

Linq ;0)>
 
It's definitlely relational, there are about 30 underlying MySQL tables linked through ODBC

My people table (really a query recordset) would be

ID .............Name................Location
1................Andrew.............Shower
2................Timmy................Bed
3.................Jane..................Bed
4.................Mr Keen.............Work
etc

I know in the real world that the order of things goes as Bed, Shower, Work....

So what I'd like is a layout on a form that makes this really clear where people are


So


Bed.................Shower..................Work
Timmy
Jane
........................Andrew
.......................................................Mr Keen

At a glance, I then can see the chronology of the day. So I want a text box (per record) to display the person's name and I want the position of that text box (left to right) to fit in with the chronology of the day.

I therefore have a very visual display of what's going on, at a glance (e.g. I can see Timmy and Jane are still in bed quickly)

I take your point about conditional formatting (that seems quite restrictive). Looks like a I need a single form, with an array of text box controls, 1 per record, whose .Left position is dependent on "Location"

Hope that's clearer, it's always hard to explain
 

Users who are viewing this thread

Back
Top Bottom