Dynamic Query creation problem

BAzZ

Registered User.
Local time
Tomorrow, 04:27
Joined
Nov 13, 2002
Messages
60
I've created a form to search my database using the Query by Form Using Dynamic QueryDef. Everything is working fine, except... I want to setup file and folder permissions to let a group of Editors to "Edit" the records and everyone else to just have read permissions. I have this working up until the readOnly users try to run the code to: Firstly Delete the dynamic query
Code:
Db.QueryDefs.Delete ("Dynamic_Query")
and secondly create/recreate the Dynamic query
Code:
Set QD = Db.CreateQueryDef("Dynamic_Query", "Select * from [qrySearch] " & (" where " + WC & ";"))

Is there perhaps a way to tackle the dyanmic query a different way, such as delete the records from just the query and then repopulate it?

Or could someone help with a totally different approach for the security (but staying away from Access Workgroups!). We would like a Read Only group and a Editors/Admin group

Thanks
 
B,

Based on the user's permissions (group), you can
launch the form as Read/Only, Full Modifications
or just data entry.

The DoCmd.OpenForm method should be able to launch
the form appropriately for the user's group.

Wayne
 
I'm not sure if we are on the same wave length, are you talking about Active Directory groups, that's what i was talking about, but after testing it having a readonly person access the database makes the file readonly for everyone.

Is there another way to setup security, again staying away from the built in Access Workgroup Security, such as having the database open readonly somehow and then have a button when pressed have a login to change the database to "Edit"? Or some other way?

Cheers
 
BazZ,

No, I'm talking about having a login form for your
database.

When a user logs in, and provides the appropriate
username/password, your software "knows" what group
they are in.

Then when they launch a form, your s/w can issue a:

DoCmd.OpenForm "SomeForm"...

The ... arguments specify what capabilities the user's
have when they open the form.

See the OpenForm in Access Help for more info.

Or post back here if I misunderstood you.

Wayne
 
Ahhhh, I understand now :o , I would like the forms to open in ReadOnly mode as the default behaviour, so there is no "login" for users, but I would like to go with what I said in my last post about having a button for the Editors/Admins to "login" and be in Edit mode, any suggestions on the way to tackle this problem?


Thanks
 
BazZ,

Regardless of how they identify themselves, YOU can
control how the form opens with the DoCmd.OpenForm
method and its arguments.

See Access Help on "OpenForm". It really should be
all that you need.

Wayne
 
Sorry WayneRyan my last message was misleading, I have set it up (from your last post) to open the forms as ReadOnly for Users, but how do I change the OpenForm Method for the 3 Editors who will need to Add/Modify Data?


Thanks
 
Sorry BazZ,

Just don't specify the last argument.

DoCmd.OpenForm "YourForm"

Will allow full edit capabilities.

Wayne
 
OK

Wayne thank you so much for your help, I have it working the way I need!
It's people like you that keep me coming back to this place, there is such a wealth of information!

Cheers until next time

BAzZ
 

Users who are viewing this thread

Back
Top Bottom