Change default settings for a control (1 Viewer)

TiagoDM

Registered User.
Local time
Today, 23:59
Joined
Apr 19, 2011
Messages
22
Hi. How to vba change default settings of a control (tab) within a form without have to open that form?

I tried many different ways but no use .. :(

See the img in attachments

I thought it could be this way

(name of the form : Registo_teste_criancas_tudo)
(name of the tab : Modificado)

forms!Registo_teste_criancas_tudo.Modificado.visible = true

but it keeps saying that it can't find the specified form. I have tried many ways (docmd.setproperty ... etc...) but i can't make it.

Help, plz...
 

Attachments

  • form_criancas_registo.jpg
    form_criancas_registo.jpg
    94.7 KB · Views: 133

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:59
Joined
Aug 30, 2003
Messages
36,127
I don't think there's any way to set the property without opening the form. You can open it hidden if you want. Or set the property in the report's open or load event.
 

TiagoDM

Registered User.
Local time
Today, 23:59
Joined
Apr 19, 2011
Messages
22
I don't think there's any way to set the property without opening the form. You can open it hidden if you want. Or set the property in the report's open or load event.

I would, but the idea is like this : if the user is administrator then some controls are visible, if not, they aren't visible, so that only administrator has access to complete form information. I would put the code associated with login form... would be another way to do it?

thanks
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:59
Joined
Aug 30, 2003
Messages
36,127
I said report but meant form. Based on what you're saying, I would use the open event of the form and show/hide controls as appropriate to the user. For max security, I'd probably hide them in design view, then make them visible if the user gets them.
 

TiagoDM

Registered User.
Local time
Today, 23:59
Joined
Apr 19, 2011
Messages
22
I would create a global variable of the user access naming 'admin' or 'user', so that I could use it to define what shows on the form and what don't.

Something like this : if vartemp is 'admin', form.regist_etc.visible = true

How can I create a global string variable to 'transport' the access category?

I already use a variable for that but I can't use it outside the login form (always empty)

ex:
dim access_level as public
msgbox access_level 'wich is defined in login form
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:59
Joined
Aug 30, 2003
Messages
36,127
In a standard module, this type of thing:

Public access_level As String
 

Users who are viewing this thread

Top Bottom