FORM OPENED AS acReadOnly IS WRITING!

G

Glint

Hi Guys,
I sometimes want my forms in read only mode, and so I would issue a command
like: DoCmd.OpenForm "AssetsGeneral", , , "[Disposed] Is Null",
acFormReadOnly.
But I was very surprised to find that the form opened and allowed data
entry. Even when I added the following, the form still wrote:
Forms!AssetsGeneral.AllowEdits = False
Forms!AssetsGeneral.AllowAdditions = False
Forms!AssetsGeneral.AllowDeletions = False
I do not want to go through the trouble of creating another form that would
do what I want. Can someone explain what went wrong? I use Access 2005.
 
A

Allen Browne

You probably have some code that is dirtying the form. In their wisdom,
Microsoft decided that if you are already editing a record, they had better
let you finish it regardless of the settings, or you would be stuck there
and unable to continue.

Look for any code that assigns a value to a bound control. Particularly
suspect would be anything in the form's Current, AfterUpdate, Open, or Load
events. Similarly anything in the Enter or GotFocus event of the first
contol on the form.

Using Access 2005 sounds like fun. :)
 
J

John W. Vinson

You probably have some code that is dirtying the form. In their wisdom,
Microsoft decided that if you are already editing a record, they had better
let you finish it regardless of the settings, or you would be stuck there
and unable to continue.

Verrrrrry interesting....

Thanks, Allen, I was not aware of that cute little oddity!
 
G

Glint

Whoa! Thanks Allen.
I guess I have to reviw a lot of things. Many forms that I had assumed would
be read only are probably writing like mad.
Thanks again.
--
Glint


Allen Browne said:
You probably have some code that is dirtying the form. In their wisdom,
Microsoft decided that if you are already editing a record, they had better
let you finish it regardless of the settings, or you would be stuck there
and unable to continue.

Look for any code that assigns a value to a bound control. Particularly
suspect would be anything in the form's Current, AfterUpdate, Open, or Load
events. Similarly anything in the Enter or GotFocus event of the first
contol on the form.

Using Access 2005 sounds like fun. :)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Glint said:
Hi Guys,
I sometimes want my forms in read only mode, and so I would issue a
command
like: DoCmd.OpenForm "AssetsGeneral", , , "[Disposed] Is Null",
acFormReadOnly.
But I was very surprised to find that the form opened and allowed data
entry. Even when I added the following, the form still wrote:
Forms!AssetsGeneral.AllowEdits = False
Forms!AssetsGeneral.AllowAdditions = False
Forms!AssetsGeneral.AllowDeletions = False
I do not want to go through the trouble of creating another form that
would
do what I want. Can someone explain what went wrong? I use Access 2005.
 

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