Change Subform by User

M

Mrs. Ugh

I have a secured database with a form containing a subform. I want to display
a different subform based on which user is logged in. I entered code in the
form's "on open" event that checks the user and sets the subform's source
object to the appropriate subform. It works great, when I am logged on as the
administrator. When I log on as someone else, I get an error "2614: You don't
have permission to insert this form into another form."

I changed permissions to give users the permission to modify the form, but
got the same error. I tried setting the subform source to [OpenArgs] and
opening the form via a module, but I got the same error. Any ideas (other
than creating 2 separate forms)?
Thanks,
Jill
 
M

Mrs. Ugh

Sorry. I tried again and got it to work if I also allowed modification of the
form and subforms...any way of doing this without allowing form modification?
Thanks,
Jill
 
P

PieterLinden via AccessMonster.com

Mrs. Ugh said:
Sorry. I tried again and got it to work if I also allowed modification of the
form and subforms...any way of doing this without allowing form modification?
Thanks,
Jill
I have a secured database with a form containing a subform. I want to display
a different subform based on which user is logged in. I entered code in the
[quoted text clipped - 9 lines]
Thanks,
Jill

What if you put both of the subforms in the form stacked on top of one
another. Then, when the form opens, based on the user, you set one of them
to be not visible. (Just use the Visible property of the subform/control).
Then the user will only see one and can only use that one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top