By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,661 Members | 781 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,661 IT Pros & Developers. It's quick & easy.

Read Only

P: n/a
Hi all,

i wanted to know how can i make my mdb file read only recommended, i
mean when the user opens the database with holding the SHIFT key it
shouldn't be read only and when opening the datababse whith the SHIFT
key it should be readonly.

i thank you for your tips in advance,

farhad

May 6 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On May 6, 1:04 am, farha...@gmail.com wrote:
Hi all,

i wanted to know how can i make my mdb file read only recommended, i
mean when the user opens the database with holding the SHIFT key it
shouldn't be read only and when opening the datababse whith the SHIFT
key it should be readonly.

i thank you for your tips in advance,

farhad

Farhad

I think you meant to say, when opening the database WITHOUT USING THE
SHIFT key, it should be read only, when using the SHIFT key, it should
be editable (not read only).

For purposes of simplicity, I will also assume this database resides
on one computer. If not, let me know.

You can make data on a form selectively read or write-enabled by using
two different load routines using a small 2 button form, where each
button has its own load routine. Pressing one button will load the
data into a form that's read only, the other button will load the data
into a form that allows full editing capabilities. You may also want
to use a password routine that allows only those with a password to
change data, but for now, we'll look on how to do it without a
password.
I would set it up like this:

Make a form that has all the data field desired for a read only user.
Make another form for the write enabled user.( a user that can make
changes to the database). If the forms are the same, then you just
need one (1) form, not both.

Make another small form that will open on default when the database
loads. This form needs 2 buttons on it. Using the On-Click event,
add the following code behind the button that opens the data as Read
Only.

DoCmd.OpenForm "MyReadOnlyFormName", acNormal, , , acFormReadOnly

Next, using the On-Click event, add the following code behind the
other button that opens the data for editing.

DoCmd.OpenForm "MyWriteEnabledFormName", acNormal, , , acFormEdit

(If you are using only 1 form, then put the same name between the " "
in each load routine.)

Wizards can help you through this as well.

Get this working, then post back to this user group, and if you need,
I can help with how to create a password forms that allows only those
with the correct password to access the form that allows editing the
data.

Sincerely,
Don


May 7 '07 #2

P: n/a
On May 7, 10:47 pm, Don Barton <DonaldB...@gmail.comwrote:
On May 6, 1:04 am, farha...@gmail.com wrote:
Hi all,
i wanted to know how can i make my mdb file read only recommended, i
mean when the user opens the database with holding the SHIFT key it
shouldn't be read only and when opening the datababse whith the SHIFT
key it should be readonly.
i thank you for your tips in advance,
farhad

Farhad

I think you meant to say, when opening the database WITHOUT USING THE
SHIFT key, it should be read only, when using the SHIFT key, it should
be editable (not read only).

For purposes of simplicity, I will also assume this database resides
on one computer. If not, let me know.

You can make data on a form selectively read or write-enabled by using
two different load routines using a small 2 button form, where each
button has its own load routine. Pressing one button will load the
data into a form that's read only, the other button will load the data
into a form that allows full editing capabilities. You may also want
to use a password routine that allows only those with a password to
change data, but for now, we'll look on how to do it without a
password.
I would set it up like this:

Make a form that has all the data field desired for a read only user.
Make another form for the write enabled user.( a user that can make
changes to the database). If the forms are the same, then you just
need one (1) form, not both.

Make another small form that will open on default when the database
loads. This form needs 2 buttons on it. Using the On-Click event,
add the following code behind the button that opens the data as Read
Only.

DoCmd.OpenForm "MyReadOnlyFormName", acNormal, , , acFormReadOnly

Next, using the On-Click event, add the following code behind the
other button that opens the data for editing.

DoCmd.OpenForm "MyWriteEnabledFormName", acNormal, , , acFormEdit

(If you are using only 1 form, then put the same name between the " "
in each load routine.)

Wizards can help you through this as well.

Get this working, then post back to this user group, and if you need,
I can help with how to create a password forms that allows only those
with the correct password to access the form that allows editing the
data.

Sincerely,
Don
I thank you for your helpul information and i will appreciate more
tips on forms password and so on!

regards,
farhaad

May 8 '07 #3

P: n/a
I thank you for your helpul information and i will appreciate more
tips on forms password and so on!

regards,
farhaad- Hide quoted text -

Farhaad,

You can create password form by doing the following:
1. Create another form with a unbound control on it. In other words,
don't attach the form to any table, just a blank form with an unbound
control on it. Remove all extaneous items (record selector,
navigation buttons, etc...)
Under the properties for the unbound control, do the following:
2. Set the Input Mask = Password (under the Data tab)
3. Validation Rule = "MyPassword"
4. Validation Text = "The message you want to appear if the password
is entered wrong"
5. On the unbound control's After Update event, Put in the code
behind the button that you used to opens the editable form.
6. In place of the code you just removed from the button's on click
event, add this code:
DoCmd.OpenForm "MyPasswordFormName"

Now, when you click on the button, the password form is called with
the unbound control on it. When you type in the password, because it
uses the Input Mask for a password, all you will see is *****. If the
password matches the Validation Rule, then the After Update event is
executed, and the input form that allows editing will open.

Hope this helps,
Don

May 11 '07 #4

P: n/a
Don,

I don't know about password, but it did help me a lot.
I used to this the hard way by codes, this way is so easy.

Thanks for info.

Jim
May 11 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.