allowing a specific user to fill a field in a form

lubbs65

Board Regular
Joined
Jun 1, 2011
Messages
80
hey, so i currently have the form just the way i want it.
thanks for the help in getting it that way (assuming you are one of those who helped).

Now i created user accounts. let's say we have Bob and Joe.

Bob and Joe can fill 9/10 same fields. however, For the 10th field i only want Bob to be able to fill it. Joe can not.

So, i obviously have to user the security wizard to make accounts, which I do know how to use.

The problem is with how the Validaiton rule would work. How would i use a validation rule for saying "if user- Bob() then enter anything" if user- Joe() do not let him write into this box" type of ordeal.

Or would I need to set their account to have specific data from the first place so for instance Bob can be an admin and joe is a full perrmissions user.

then just replace the above statement with Admin() where it sais bob, and full permissions user where it sais joe?

To make it clear though, they both are filling out the same form. There are just certain fields in the form that Joe is not allowed to fill.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
A quick and dirty way to do that is set the textbox (or whatever) that is in question to enabled = no, then on the open form event test for Bob, if yes then enable the textbox. A better way would be to have a table of valid users (which I presume you have) that has stuff like user name, login name, password etc. Add a column which would contain yes/no update the textbox in question. At login save that yes/no and test for it at open form event.

hth Jack
 
Upvote 0
A quick and dirty way to do that is set the textbox (or whatever) that is in question to enabled = no, then on the open form event test for Bob, if yes then enable the textbox. A better way would be to have a table of valid users (which I presume you have) that has stuff like user name, login name, password etc. Add a column which would contain yes/no update the textbox in question. At login save that yes/no and test for it at open form event.

hth Jack

how can I go about doing this using a macro? I would need a condition and an argument. I don't know how to write the condition, and then I don't see an action involving enable or what have you.

SydneyGeek:
That thread is very helpful, however I still have a few questions:

On form load even you have the option for editing a form. What about if they are opening a new form? Then, these rules seemed to only apply for an overall form rather than a certain field from within a form. So how can I just enable a field If I go by dogdays method while still using your concept?
 
Last edited:
Upvote 0
If you want to set up user permissions without user-level security, take a look at this tutorial... http://www.mrexcel.com/forum/showthread.php?t=248191

Denis

also when I run your code I get an error. It highlights:
Me.txtUser = Environ("username").

in particular it highlights ".tstUser ="

And my plan of attack was to do this afterword:

after your first block of code:
Code:
If iAccess = 3 Then
Me.Form_field.Enabled = True
Me.Form_field2.Enabled = True
End If

I think this is the correct approach, I just need to get the first part (your code snippet) correct. THANKS!
 
Upvote 0

Forum statistics

Threads
1,224,618
Messages
6,179,917
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top