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

Read Only Form allows Edits

Status
Not open for further replies.

abanning

MIS
Jul 9, 2001
8
US
Hello,

I have a form where the Allow Edits, Allow Additions, Allow Deletions and Data Entry are all set to NO. I open the form using two different methods from another form, asking for 2 parameters. If the user provides the first (DocumentNum) AND second (EmployeeID) then I open the form as allowing EDITS with the following:
Code:
  DoCmd.OpenForm stDocName, , , stLinkCriteria,         acFormEdit, acWindowNormal
OR if they provide the DocumentNum only then I open it as ReadOnly:
Code:
   DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly, acWindowNormal
When the form opens as "ReadOnly", the comboboxes are locked and some of the textboxes are locked but the users are able to select and EDIT data in other textboxes, most definitely not the intention. Once one box has been edited the whole form opens as Editable. I do not want them to be able to edit anything when the form opens as ReadOnly.

Please help!
Thanks in advance for any help!!!
 
This is probably stating the obvious but - You haven't got any code in the OnOpen or other events which is activating the objects in Question. Then further code that re-activates the whole form into data entry mode?

Sandy
 
I have code on the BeforeUpdate, Current, Load and UnLoad events of the form which in part call other modules I have created, but none of the code re-opens or reinitializes the form. Certain controls on the form are being populated via one of the modules called on the form's Current Event, but the controls being populated are calculated controls and are locked at all times.

I appreciate any help provided.
Thanks!
 
It's really odd that only certain fields are being activated on first entry. Have you tried disabling the code (on a copy) to see if that is affecting the form.

I've had a quick look at some of my forms and it seems solid locked no matter what i do. Sandy
 
As a matter-of-fact I am right in the middle of doing just that. My customer has requested that the project be deployed even though I am having these issues, understanding that another version will have to be provided once this issue is resolved.
Thanks again!
 
I'd be interested in knowing what caused the problem - might prove useful in the future. Sandy
 
Currently I have bystepped the issue by disabling all textboxes, comboboxes and buttons (releasing necessary ones)upon start-up under the prescribed parameters.
I must say, though, that it appears the population of certain textboxes is what allowed the edit capabilites.
Once I debug the whole project and discover the issue I will certainly let you know the specific problem.

Once again, thanks so much for your help!

Andrea
 
Currently I have bystepped the issue by disabling all textboxes, comboboxes and buttons (releasing necessary ones)upon start-up under the prescribed parameters.

I must say, though, that it appears the population of certain textboxes is what allowed the edit capabilites.
Once I debug the whole project and discover the issue I will certainly let you know the specific problem.

Once again, thanks so much for your help!

Andrea
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top