1 (edited by v_pozidis 2020-08-27 11:18:21)

Topic: acces for some buttons !HELP!!!!

In my example I have 2 users (the firs is the admin/admin  and the other is  the olos/ena which has no administrator rights.

What I wanna do is  when I choose the Administrator i should have full access in the buttons of the form2
When I choose the user olos I should have limited access in the buttons of form2. Can I do that and if yes is there a way to choose the buttons that can  be enabled for the user to use ? pleas feel free to work on my example.
please help. I have finished my project and this is the one to complete it. I use the MVDB 6.4 beta

Post's attachments

Attachment icon Access.zip 333.88 kb, 252 downloads since 2020-08-27 

2 (edited by brian.zaballa 2020-08-27 12:23:13)

Re: acces for some buttons !HELP!!!!

Here's some changes

Post's attachments

Attachment icon Access-Updated.zip 497.27 kb, 235 downloads since 2020-08-27 

brian

Re: acces for some buttons !HELP!!!!

I've fixed the database. You can also move the code from Form2.Onshow to Form1.Onshow for it to run just once and not when opening the form2

Post's attachments

Attachment icon Access-Fix.zip 497.13 kb, 239 downloads since 2020-08-27 

brian

4 (edited by v_pozidis 2020-08-28 05:52:30)

Re: acces for some buttons !HELP!!!!

Thanks for your help, but is there an other way? I have over 70 buttons  to give access in an administrator user.  I like to have better a check box for each button. So if the checkbox is checked ithe button should be enabled.  Can you help me ? Use my example

Re: acces for some buttons !HELP!!!!

Here's a sample.

Post's attachments

Attachment icon Access-Checkbox.zip 501.31 kb, 293 downloads since 2020-08-28 

brian

Re: acces for some buttons !HELP!!!!

Yes!!!! thank's so much.

Re: acces for some buttons !HELP!!!!

brian.zaballa wrote:

Here's a sample.

Hi , I have copy/paste your script in my software but in the Access form it does't show the Buttons. I have no idea why?Can you please help me to find my error ?

Re: acces for some buttons !HELP!!!!

v_pozidis wrote:
brian.zaballa wrote:

Here's a sample.

Hi , I have copy/paste your script in my software but in the Access form it does't show the Buttons. I have no idea why?Can you please help me to find my error ?

You need to update the database. In there you have to indicate the buttons you want to give access to the users

brian

Re: acces for some buttons !HELP!!!!

Make sure that the order of the buttons/components in your database is the same in the button array from script

 ButtonArr : Array of TdbButton = [Form2.Button1, Form2.Button2, Form2.Button3, Form2.Button4, Form2.Button5, Form2.Button6, Form2.Button7, Form2.Button8];
Post's attachments

Attachment icon Access-Updated.zip 502.2 kb, 259 downloads since 2020-08-30 

brian

10 (edited by v_pozidis 2020-08-30 09:13:52)

Re: acces for some buttons !HELP!!!!

brian.zaballa wrote:

Make sure that the order of the buttons/components in your database is the same in the button array from script

 ButtonArr : Array of TdbButton = [Form2.Button1, Form2.Button2, Form2.Button3, Form2.Button4, Form2.Button5, Form2.Button6, Form2.Button7, Form2.Button8];

I do not have the same Forms and buttons in my software. I have over 50 buttons in different forms.  here are my buttons according your script

  ButtonArr : Array of TdbButton = [frmAgenda.Button1, frmAgenda.Button2, frmAgenda.Button3, frmAgenda.Button4,
    frmCreateStoixeia.Button13, frmCreateStoixeia.Button14, frmCreateStoixeia.Button15, frmCreateStoixeia.Button12, frmCreateStoixeia.Button6, frmCreateStoixeia.Button3,
    frmCreateStoixeia.Button10,frmCreateStoixeia.Button1, frmCreateStoixeia.Button2, frmCreateStoixeia.Button4, frmCreateStoixeia.Button9, frmCreateStoixeia.Button9,
    frmCreateWork.Button7, frmCreateWork.Button8, frmCreateWork.Button9, frmCreateWork.Button3, frmCreateWork.Button1, frmCreateWork.Button2, frmCreateWork.Button5,
    frmCustomWork.Button2, frmStoixeia.Button4, frmStoixeia.Button5, frmStoixeia.Button6, frmWork.Button4, frmWork.Button5, frmWork.Button6,
frmDiafora.Button2,frmDiafora.Button3,frmDiafora.Button8,frmDiafora.Button11,frmDiafora.Button14,frmDiafora.Button17,frmDiafora.Button32,frmDiafora.Button20,
frmDiafora.Button23,frmDiafora.Button26,frmDiafora.Button29,frmDiafora.Button35,frmDiafora.Button38,frmDiafora.Button41,frmDiafora.Button44,frmDiafora.Button47,frmDiafora.Button50,
frmDiafora.Button53,frmDiafora.Button56,frmDiafora.Button59,frmDiafora.Button3,frmDiafora.Button6,frmDiafora.Button9,frmDiafora.Button12,frmDiafora.Button15,frmDiafora.Button18,
frmDiafora.Button33,frmDiafora.Button21,frmDiafora.Button24,frmDiafora.Button27,frmDiafora.Button30,frmDiafora.Button36,frmDiafora.Button39,frmDiafora.Button42,frmDiafora.Button45,
frmDiafora.Button48,frmDiafora.Button51,frmDiafora.Button54,frmDiafora.Button57,frmDiafora.Button60,frmDiafora.Button1,frmDiafora.Button4,frmDiafora.Button7,frmDiafora.Button10,
frmDiafora.Button13,frmDiafora.Button16,frmDiafora.Button31,frmDiafora.Button19,frmDiafora.Button22,frmDiafora.Button25,frmDiafora.Button28,frmDiafora.Button34,frmDiafora.Button37,
frmDiafora.Button40,frmDiafora.Button43,frmDiafora.Button46,frmDiafora.Button49,frmDiafora.Button52,frmDiafora.Button55,frmDiafora.Button58,
frmCreateAgendayp.Button1,frmCreateAgendayp.Button6, frmCreateTele.Button1, frmCreateYpothesi.Button1,frmCreateYpothesi.Button4,frmCreateYpothesi.Button7,
frmCreateYpothesi.Button2,frmCreateYpothesi.Button5,frmCreateYpothesi.Button8,frmCreateYpothesi.Button3,frmCreateYpothesi.Button6,frmCreateYpothesi.Button9,frmCreateYpothesi.Button13,
frmCreateYpothesi.Button10,frmCreateYpothesi.Button11,frmCreateYpothesi.Button12, frmCreateFakelo.Button1, frmCreateChooseDikigoro.Button3,
frmYpothesi.Button1,frmYpothesi.Button2,frmYpothesi.Button3, frmCreateArxeia.Button1, frmCreateSymvolaio.Button8,frmCreateSymvolaio.Button4,frmCreateSymvolaio.Button9,
frmCreateSymvolaio.Button5,frmCreateSymvolaio.Button10,frmCreateSymvolaio.Button6,frmCreateSymvolaio.Button2,frmCreateSymvolaio.Button1,frmCreateSymvolaio.Button7,
frmSymvolaia.Button3,frmSymvolaia.Button4,frmSymvolaia.Button5];

is there a mistake ?

11 (edited by brian.zaballa 2020-08-30 11:20:10)

Re: acces for some buttons !HELP!!!!

You need to populate the component table with the same order of that array of Buttons.

You can use database GUI for that such as navicat(paid software) or DBBrowser, etc. for you to populate it

Or you can use the import function of MVD. See import.png on the zip. I created components.csv based on your array. Make sure to Clear the Component first before doing an import. You can skip the 4th column of the csv for it is your reference. You can edit Column 2 and 3 for the benefit of your users. So that they can easily understand what to give access to other users.

Post's attachments

Attachment icon Access-Populated.zip 531.15 kb, 264 downloads since 2020-08-30 

brian

Re: acces for some buttons !HELP!!!!

brian.zaballa wrote:

You need to populate the component table with the same order of that array of Buttons.

You can use database GUI for that such as navicat(paid software) or DBBrowser, etc. for you to populate it

Or you can use the import function of MVD. See import.png on the zip. I created components.csv based on your array. Make sure to Clear the Component first before doing an import. You can skip the 4th column of the csv for it is your reference. You can edit Column 2 and 3 for the benefit of your users. So that they can easily understand what to give access to other users.

Thank's again. I have read your script and every time I found it interesting. You have gave me in your answers  different  solution. I can say that the last one was much more difficult, but works. I am wondering isn't there a easy way ?

Re: acces for some buttons !HELP!!!!

v_pozidis wrote:
brian.zaballa wrote:

You need to populate the component table with the same order of that array of Buttons.

You can use database GUI for that such as navicat(paid software) or DBBrowser, etc. for you to populate it

Or you can use the import function of MVD. See import.png on the zip. I created components.csv based on your array. Make sure to Clear the Component first before doing an import. You can skip the 4th column of the csv for it is your reference. You can edit Column 2 and 3 for the benefit of your users. So that they can easily understand what to give access to other users.

Thank's again. I have read your script and every time I found it interesting. You have gave me in your answers  different  solution. I can say that the last one was much more difficult, but works. I am wondering isn't there a easy way ?

My pleasure. That's the easiest way I can think about for now. Hoping that MVD Team add feature like that.

brian