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

writing a generic allowedits function or sub

Status
Not open for further replies.

idd

Programmer
Apr 19, 2002
165
GB
Dear All,

I have wriiten generic Openform and close form SUBs in the Modules area, which I call by their names to open and close forms, this saves me having to retype the full code for opening and closeing forms, I have also written variations to the openform where it opens in read only or edits etc.
The code for this I will give below


Sub OpenFormAdd(OF, CF As String)
DoCmd.Openform OF, acNormal, , , acFormAdd, acDialog
DoCmd.Close acForm, CF, acSavePrompt
End Sub

-------------------


the sub is called from the on click events of a button on any form by simply typing the name OpenFormADD then the name of the form to open followed by me.name to indicate the current is the form to close.


I want to know is it possible to write a generic sub, which will change the data entry status of a form, my goal is to have a sub which when called will allowedits on the current form.

I can't seem to get it to work though. I could work around it and open the form again with allowedits but that if possible I want to just change the property instead of re-opening the form.

Thanks in advance for any help.

Idd
 
Screen.ActiveForm.AllowEdits= True/False

Good luck,
[pipe]
Daniel Vlas
Systems Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top