acFormReadOnly doesn't display one subform

  • Thread starter BYoung via AccessMonster.com
  • Start date
B

BYoung via AccessMonster.com

I have a tab control that contains 7 tabs, each with a different subform-
Employee Info
Personal Info
Training
Testing
HR Records
Uniforms
Performance

I also have a couple switchboards set up, the first lets the user enter the
managment view or the admin view. in the management view the manager can
click the Employee Views button to view the tab control in read only mode.
Here is the code for opening this form in public(read only) view

Private Sub cmdpubempview_Click()
'command to access employee views in public(read only) mode
DoCmd.OpenForm "frmEmployeeView", acNormal, , , acFormReadOnly
End Sub

The problem I'm having is that 6 of the 7 tabs show their subforms yet for
some reason the uniform tab doesn't show the uniform subform. Also I have a
quicksearch combo box that in acNormal view will allow you to select whose
records to view, however, in read only mode this box is not active.

Any Ideas how to avoid this. Should I create a separate form specifically
for public viewing and lock all the fields? I would think there would be a
better way to deal with this problem.
 
J

J. Goddard

Hi -

If I interpret the question correctly, it is not the frmFmployeeView
that should be read-only - it is the subforms on the tabs. surely you
want the managers to be able use the combo box to select whose records
they want to see?

You can change the allowedits and other properties of the sub-forms to
Yes or No using VBA, depending on which class of user is viewing them.

When you say that the 7th tab doesn't show the uniform subform - do you
mean it doesn't show the sub-form at all, does it show the form, but
with no data?

John
 
B

BYoung via AccessMonster.com

Hello,
You're correct that I would like the managers to be able to use the combo
box to pick employees. When you talk about user class, are you talking about
something in the Microsoft access built in security? I'm learning access and
haven't quite dug into the specifics of the microsoft security features.

As for the 7th tab, you're correct in saying that the form does not show at
all. All the other tabs show their subforms, but when you click on the
uniforms tab it is completely blank.

Any Ideas?

J. Goddard said:
Hi -

If I interpret the question correctly, it is not the frmFmployeeView
that should be read-only - it is the subforms on the tabs. surely you
want the managers to be able use the combo box to select whose records
they want to see?

You can change the allowedits and other properties of the sub-forms to
Yes or No using VBA, depending on which class of user is viewing them.

When you say that the 7th tab doesn't show the uniform subform - do you
mean it doesn't show the sub-form at all, does it show the form, but
with no data?

John
I have a tab control that contains 7 tabs, each with a different subform-
Employee Info
[quoted text clipped - 23 lines]
for public viewing and lock all the fields? I would think there would be a
better way to deal with this problem.
 
J

J. Goddard

Sorry, no - I was referring to what the user selected from a switchboard
- admin or management. Just as an aside, I hope you have a way of
preventing your managers from selecting admin? You know the old saying
about people who know just enough to be dangerous......

If the 7th tab is completely blank, it sounds as if perhaps the
"visible" setting for that subform control has been set to "no"

John

Hello,
You're correct that I would like the managers to be able to use the combo
box to pick employees. When you talk about user class, are you talking about
something in the Microsoft access built in security? I'm learning access and
haven't quite dug into the specifics of the microsoft security features.

As for the 7th tab, you're correct in saying that the form does not show at
all. All the other tabs show their subforms, but when you click on the
uniforms tab it is completely blank.

Any Ideas?

J. Goddard said:
Hi -

If I interpret the question correctly, it is not the frmFmployeeView
that should be read-only - it is the subforms on the tabs. surely you
want the managers to be able use the combo box to select whose records
they want to see?

You can change the allowedits and other properties of the sub-forms to
Yes or No using VBA, depending on which class of user is viewing them.

When you say that the 7th tab doesn't show the uniform subform - do you
mean it doesn't show the sub-form at all, does it show the form, but
with no data?

John

I have a tab control that contains 7 tabs, each with a different subform-
Employee Info

[quoted text clipped - 23 lines]
for public viewing and lock all the fields? I would think there would be a
better way to deal with this problem.
 
B

BYoung via AccessMonster.com

John-

As for the security issue, I'm using a very remedial security setup that I
saw some code for and groomed it to do what I needed. I've got two tables,
one for adminaccess, the other for mngraccess. I insert the allowed peoples
names and passwords into these tables. When the user selects admin or
Manager they will be asked for their username and password. if they're not
on "the List" then they are not allowed to go any further. It's not air
tight, but it's a good deterent for anyone just nosing around. Due to the
way i have the start up configured, you pretty much have to know about the
access F11 shortcut to get deeper into the DB. Is there a way to turn that
off, and still be able to get in and work with stuff as the developer?

Ya know the crazy thing about the stinking uniform tab is that I've compared
it's properties with all the other subforms and it appears that everything is
the same. Visible is set to True...I can't figure it out! I think the
allowedits code would probably work, but as novice as I am I'm not good at
making up code off the top of my head. How do you think I should approach
this?

J. Goddard said:
Sorry, no - I was referring to what the user selected from a switchboard
- admin or management. Just as an aside, I hope you have a way of
preventing your managers from selecting admin? You know the old saying
about people who know just enough to be dangerous......

If the 7th tab is completely blank, it sounds as if perhaps the
"visible" setting for that subform control has been set to "no"

John
Hello,
You're correct that I would like the managers to be able to use the combo
[quoted text clipped - 31 lines]
 
J

J. Goddard

Hi -

First, the one I can answer - making the forms modal disables the F11
access to the database window.

Developers can bypass the startup form by holding down the "Shift" key
while opening the application; that can be disabled too.

What I have done is put a "secret" second exit on to the "exit" buttons
of my main forms. A normal click on the exit button closes the
application, but if I do a Ctrl-Shift-right Click on the exit button, I
get to the database window. It's just a small bit of code on the
Keypress event (I think - I'd have to check) of the button. Needless to
say, I don't publish that one.

I don't think you need to tables for Admin / Manager - you only need
one, which has the username, password and access level (i.e. admin or
manager). You might want to consider making that a hidden table.

Here's one approach. Set up a global boolean variable, call it for
example Admin. When a user logs in, you can set that variable to true
or false depending on whether or not they have admin privileges.

Global variables are declared in modules which are not in forms (created
or edited using Modules in the database window.

Because this Admin variable is global (public), it van be referenced
anywhere, including forms.

In the On Open event of the subforms, you could put

me.allowedits = admin

i.e. if Admin is true (an admin user), then allow edits to the form.

The 7th tab thing is a mystery; it really sounds like a Visible setting
somewhere. Do you have any code at all that references that sub-form or
it's control?

Hope this helps, a bit at least.

John



John-

As for the security issue, I'm using a very remedial security setup that I
saw some code for and groomed it to do what I needed. I've got two tables,
one for adminaccess, the other for mngraccess. I insert the allowed peoples
names and passwords into these tables. When the user selects admin or
Manager they will be asked for their username and password. if they're not
on "the List" then they are not allowed to go any further. It's not air
tight, but it's a good deterent for anyone just nosing around. Due to the
way i have the start up configured, you pretty much have to know about the
access F11 shortcut to get deeper into the DB. Is there a way to turn that
off, and still be able to get in and work with stuff as the developer?

Ya know the crazy thing about the stinking uniform tab is that I've compared
it's properties with all the other subforms and it appears that everything is
the same. Visible is set to True...I can't figure it out! I think the
allowedits code would probably work, but as novice as I am I'm not good at
making up code off the top of my head. How do you think I should approach
this?

J. Goddard said:
Sorry, no - I was referring to what the user selected from a switchboard
- admin or management. Just as an aside, I hope you have a way of
preventing your managers from selecting admin? You know the old saying
about people who know just enough to be dangerous......

If the 7th tab is completely blank, it sounds as if perhaps the
"visible" setting for that subform control has been set to "no"

John

Hello,
You're correct that I would like the managers to be able to use the combo

[quoted text clipped - 31 lines]
for public viewing and lock all the fields? I would think there would be a
better way to deal with this problem.
 

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