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!

Forms allowing edits

Status
Not open for further replies.

KentMorand

Technical User
Feb 27, 2002
32
US
When I open a form I want the user to have to hit an edit button in order to be able to edit the info displayed. In the form load I've put me.allowedits = false and in the properties of the form I've set allow edits to no. It did work right at one time but when I open the form now I can change any info without havign to click the edit button. Any idea why this would happen?
 
What's the code behind your Edit Button? Maybe you're enabling something and not disabling later on or vice versa.

Jim DeGeorge [wavey]
 
Thanks for getting back to me. The edit button shouldn't even be a factor here as it won't come into play until it is pressed but here is the code.

Private Sub cmdEdit_Click()

Me.AllowEdits = True
cmdSave.Enabled = True

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

Exit_cmdEdit_Click:
Exit Sub

Err_cmdEdit_Click:
MsgBox Err.Description
Resume Exit_cmdEdit_Click

End Sub

With me.allowedits = false in the form load event all fields should be unavailable for change but for some reason you can change whatever you want. I have another db that has a form that works correctly and it seems to have the exact same properties as the one I am having trouble with. Thanks in advance for the help.
 
I don't know "cmdSave." What version of access are you using?



Jim DeGeorge [wavey]
 
The cmdsave.enabled = true is just there b/c it is false on form load and they have to be able to save a record if they edit it. I am using access 2000. Thanks again.
 
Maybe instead of using "Me." use the form name

example:

Form_YourFormName.AllowEdits = True (or False)

 
Thanks for replying ancb but I'm afraid that didn't work either. I have no idea why this won't work. Like I said earlier it worked at one point and I really haven't changed any on teh on form load info.. Gotta love access... lol
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top