Topic: recreating a project

Hello.
I  need some suggestions.

I’ve created a project about the income and expenses of a school. It includes about 20 tables, each with several items, and many different forms. Now I want to use it for two different schools: an elementary school and a high school.

Is there a way to avoid having to recreate all the tables and forms again? It’s very time-consuming. I just want to be able to choose between the two schools at the beginning using a ComboBox.

Thank you.

Re: recreating a project

Hello Crozon

Si pour le primaire et le lycée les champs restent les mêmes, tu peux passer par une combobox proposant les deux éléments.
Je pratique de la sorte pour une application de gestion bancaire familiale faite avec MVD (avec l'aide de Sparrow et de Derek).
Une combobox liste tous les différents comptes que je veux gérer et cela fonctionne parfaitement.

Par contre tu devras une table distincte pour les deux écoles avec les mêmes champs.

If the fields remain the same for elementary and high school, you can use a combo box that offers both elements.
I use this method for a family banking application made with MVD (with help from Sparrow and Derek).
A combo box lists all the different accounts I want to manage, and it works perfectly.

On the other hand, you will need a separate table for the two schools with the same fields.

JB

Re: recreating a project

Salut Identity, Jean,
Ça va les Deux?
Another option is to use 'user authorisations'.
Have a look at the attachment.
The passwords are 'admin', 'Identity' and 'Derek'
Derek can only see 'Elementary Schools'
Identity can see 'Nursery Schools' and 'High School'
Neither Derek nor Identity can see the button to access users (this is only visible and available to Admin).
Derek and Identity get a warning message and cannot access the 'set up' option which shows as disabled.
There are many combinations you can use so it is very flexible and your existing project shouldn't need to have any changes.
Apologies that the data makes little sense (I just quickly changed an old project) but I hope it shows you another possibility.
As a side issue, 20 tables seems quite high;  maybe your data schema could be rationalised (although without seeing your project, it's hard to be certain).
Regards,
Derek.

Post's attachments

Attachment icon identity option.zip 447.15 kb, 41 downloads since 2025-05-05 

4 (edited by identity 2025-05-10 03:33:04)

Re: recreating a project

Hi guys
in the attached project I used a combobox (Form 2)
what I need is that Elementary teachers should only be visible for the user "Derek" and high school teacher should be visible for "Identity"
but that combobox shows all the teachers for both users.
How can I fix it?

Post's attachments

Attachment icon identity option1.zip 345.57 kb, 24 downloads since 2025-05-10 

Re: recreating a project

Hi,
All you need to do is add filters to the 'teachers' combobox on Form2 (please have a look at the attachment).
Be aware that the filter values are case sensitive (ie 'High School teacher' will work  but 'high school teacher' will not).
Regards,
Derek.

Post's attachments

Attachment icon identity.jpg 92.51 kb, 7 downloads since 2025-05-10 

Re: recreating a project

thank you Derek
It was my bad to confuse you
by "elementary teacher" I didn't mean only the phrase "elementary teacher" . I meant every elementary teacher (about 20 teachers) at a particular school.

Re: recreating a project

Hi Identity,
I think the easiest option (no script) is to go with Jean's suggestion.
1.  use a combobox to select which type of teacher and school (Elementary or High School)
2.  use parent comboboxes to restrict which teachers and which schools are shown.
Derek.

Post's attachments

Attachment icon identity schools.zip 438.11 kb, 19 downloads since 2025-05-12 

Re: recreating a project

Hi Derek.
Sorry, but for Form3 you can't do without a little script, otherwise the new type doesn't appear in other tables without reloading the form.

procedure Form3_TableGrid1_OnChange (Sender: TObject);
begin
  if Form3.TableGrid1.Focused then
  begin
    Form3.TableGrid2.dbUpdate;
    Form3.TableGrid4.dbUpdate;
  end;
end;

Re: recreating a project

I was aware of this. 
My approach was to keep it as simple as possible and as Form3.TableGrid1 will (as per Identity's message) only contain 2 values (Elementary and High School), it didn't seem worth adding a script for something that has such low volatility and is unlikely to change once it has been set up.
Ultimately, it is Identity's choice.