Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restricting Design View for queries and reports only 5

Status
Not open for further replies.

fchan

MIS
Jul 2, 2001
47
US
Is there anyway to restrict the design view for queries and reports only? I don't the users changing the form design, but I want them to be able to create their own queries and reports. Is this possible?
 
My guess is it is possible, but only with quite a bit of coding involved.

You might want to consider merely hiding all of the forms in your database windows. Doing this will likely prevent anyone but a super-power-user from getting access to your forms. You can check the hidden attribute by right clicking on a form in the database window and selecting the "properties" dialog, or by manipulating properties in vba.

I'm sure there are more secure methods of restricting access to forms, but this one has the benefit of being really easy while still preventing most users from changing forms. -- Herb
 
The normal process for achieving this would be to establish user security and give users only the permissions you want them to have. This is a relative cinch using user security, but if you've never done it you will need to do some boning up in the books and/or use the security wizard.

Steve King Growth follows a healthy professional curiosity
 
Thanks Steve for the suggestion on using the user security. I've done that, but then once I turn on the workgroup security, I have to login for all my databases.

I looked at the documentation on Microsoft's web site regarding working with secured and non-secured Access database and they suggest setting up an icon for the secured database and one for access all non-secured databases. However, I wasn't to clear on how to do it.

Does anyone have any suggestion on how to only use the workgroup for the specific database I want to secure and then have my other databases unsecured?

Thanks.
 
I have a 1 secure database which I provide users access to via the shortcut. You can supply the MDW for the database in the commandline and have access use a specific MDW for that database. Then the user can stay in the default MDW for working in nonsecured db's. Look up commandline options for the switches in the online help. Here's a sample of my shortcut so you can see how it goes.

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /wrkgrp s:\amp\system.mdw S:\Amp\Amp.mdb

Hope that helps! Joe Miller
joe.miller@flotech.net
 
Joe is right on target. I use exactly the same shortcut but my target property includes the database to be opened.

"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" f:\groups\sdv\dmats\test\v01-q2-00\dmats97.mdb /USER scking /PWD /WRKGRP F:\GROUPS\SDV\DMATS\test\V01-Q2-00\dmatssecure.MDW

Recommendations are to make sure you use the quotes around any path that contains a space. If you want to automate the log in a little you can use the /USER switch and then just enter your password. This all depends on how secure you want the database to be and how secure your desktop is.

Steve King Growth follows a healthy professional curiosity
 
Thanks JoeMiller and scking, both your suggestions were helpful. But the only problem with the user-level security is that someone can bypass all the security of the workgroup file is they have access to open the file in Windows Explorer.
 
If that's the case then your security is not set up properly. There is a way to tell a database that only one .MDW can be used when opening it. I suggest that you read up a little bit more in the online help about security because there are MANY options and everybody's situation is different.

Joe Miller
joe.miller@flotech.net
 
You can verify .MDW file:

Private Sub Form_Open(Cancel As Integer)
if SystemDB<>&quot;C:\MyDirectory\MySecure.MDW&quot; then
msgbox &quot;You may join valid .MDW file!&quot;
docmd.quit
end if
end sub

Aivars
 
The 'Admin' user is the default user for opening an Access database. All users have the 'user' group permissions. If users can open the database then at the very least you need to take the following actions:

1) Verify that the 'Admin' user only has 'user' group permissions.
2) Remove all permissions from the 'user' group
3) Create a new group (MyUsers maybe) to act as the 'user' group
4) Assign the MyUsers group permissions to all users.

So even though the 'Admin' user inherits all permissions from the 'users' group there are no permissions to inherit. Since you have assigned MyUsers group permissions they inherit whatever permissions you want. DO NOT give the 'Admin' user MyUsers group permissions.

Steve King Growth follows a healthy professional curiosity
 
Thanks Aivars. That sub procedure works great.
 
Building off Aivars snippet, maybe you would have the system database at different locations for different users at different sites.

Steve King

Public Function IsRightSystemDb() As Boolean

Dim strSystemDb As String
Dim intChars As Integer

strSystemDb = SystemDB
intChars = Len(strSystemDb)
For intChars = intChars To 0 Step -1
If Mid$(strSystemDb, intChars, 1) = &quot;\&quot; Then
strSystemDb = Mid$(strSystemDb, intChars + 1)
If strSystemDb = &quot;dmatssecure.mdw&quot; Then
IsRightSystemDb = True
GoTo Exit_Proc
Else
IsRightSystemDb = False
End If
End If
Next intChars

Exit_Proc:
Exit Function

HandleErr:
Resume Exit_Proc
Resume

End Function Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top