Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Who has helpful tip?

Status
Not open for further replies.

Tsjompie

Programmer
May 28, 2008
3
NL
I created a form with like 100 buttons and 500 rectangles using code.

Reason for building the form using code is, that I'm in full control of what the events trigger, namingconvention, control type ID's.
I switch to design mode for creating the form (no MDE capabilities). The final environment needs to run in mde.

For saving multiple layouts (imaging the buttons are tables and the rectangles are areas and niches in an outside terrace, so each button stands for a table on a terrace). I write the location on the form, height, width, visibility, etc etc of the controls to a database table.

Accessing a saved map leads to reading an access table AND going through each control on the form.

How to have that "in sync". I mean accessing the control and looping through a recordset to have the controls formatted and put in position.
Is there a better way to approach this?

Thx
 
I'll put this really simply.

Yes. You've created a monster.

What are you trying to achieve?

C
 
A monster :)
It didn't scare me until now.
Even worse... it seems to work perfectly.

I know there is a maximum number of controls to put on a form, and I'm close to what is possible.

As our terrace has apprx. 70 tables and I want the tables (= buttons) to highlight with different colors (for that purpose I use the rectangles (4 per button, hidden under the button). Using the backcolor I show the number of receipts per table. With other rectangles I show the niches and layout of the terrace.

Reason for this is:
1. When adding controls they are 'send to front' on the already existing form. I need the rectangles to be behind the buttons. Using code to create the form, I'm capable doing so. All controls need one or more events. In the current setup I'm capable of adding any event to any control.
2. At least I need 70 buttons on the form. Adding them manually is a burden, in particular because the events are not completely clear at this moment and at least three events are relevant now.
3. Creating forms on the fly (instead of a prebuild with all controls on it, as I do it now) needs the MDB environment to run. I prefer a compiled database for this.

When there is a better way to have this set up, please inform me
 
Tables? Terrace? You run a restaurant?

What is the business problem you are trying to solve?

C
 
Distibuting a register system among collegues with similar terraces, with different layouts.

Customer on table leads to receipt (more than one person or group on table leads to more than one receipt). Ordering drinks and food during day, and pay for that (based on table) later the day.

So.... Click button (table opens), put drinks and food on table and print receipts at end of day.

In short, that's what it's all about.
I need a form showing the terrace layout. That's why all those buttons are necessary.
In fact... when putting drinks on table another form is used, also with like 40 buttons displaying all possible drinks.

Thx
 
If you are really committed to writing something, why not use a listbox or combobox for selecting the table (that people eat at; I read the Access object at first glance).

If you are trying to do something graphically, then I guess your approach is as good as any other. Although I think you are going to have a hard time using an MDE if that is a limitation (I would have guessed it would work unless you are trying to programmatically add code to the buttons as opposed to macros).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top