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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

acFormReadOnly or AllowEdits are not making my forms read only

Status
Not open for further replies.

csbdeady

Programmer
May 18, 2002
119
GB
Hi there

Working to a deadline of tomorrow morning and came across a problem:(

If I set the AllowEdits property to false and load a form it works fine and you can't edit the form.

BUT if I do the same but load the above form from another form via a button you can edit the supposedly non-editable form. I've stepped through the code and it definitely sets AllowEdits to false but still allows edits...

I've also tried using acFormReadOnly with Docmd.openform:

DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, acFormReadOnly

but this opens the form allowing full read-write.

Please can someone suggest what's amiss.
 
try changing the actual allow edits property of the form.

[forms]![formname].allowedits = false

Nick
 
Thanks

I tried that and it completely ignores the false!

I think I've traced the problem to having some code entering a value on a form in the OnCurrent event after the record being set to AllowEdits = false.

Guessing here... what may be happening is that AllowEdits does = false but then when the OnCurrent tries to write to the form, the setting is changed to True.

I've put a test in to see if AllowEdits = false and if so then don't write anything to the form.

The above seems to work fine except its given me a knock-on set of problems *lol* <---- always the way in coding!

If anyone's got a defacto FAQ lurking around on this please let me know.

-Colin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top