INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS
Come Join Us!
Are you a
Computer / IT professional?
Join Tek-Tips now!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts
- Keyword Search
- One-Click Access To Your
- Automated Signatures
On Your Posts
- Best Of All, It's Free!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.
Do you enjoy these
Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Posted: 20 Jun 03
Something it's useful to have a form serving as a viewer so data can't be add and/or edit and be able to change it as a editor on a click of a button
Here's the way I do it :
The Forms and subforms properties is set to
.AllowAdditions = false
.AllowEdits = False
then create a button that will contain the following code in the On Open events
Me.AllowAdditions = True
Me.AllowEdits = True
'if there's no subform don't include the rest of the code
For Each myControl In Controls
Select Case myControl.ControlType
myControl.Form.AllowAdditions = True
myControl.Form.AllowEdits = True
The advantage of my code is that you don't need to enter the form/subforms name and you can add/remove subforms within the form without having to change that part of the code...code it and forget it!(just like the chicken in the ads).
there's surely some bad points to my code but like a good politician, I won't mention them
"Computer Science is no more about computers than astronomy is about telescopes"
E. W. Dijkstra.
Back to Microsoft: Access Forms FAQ Index
Back to Microsoft: Access Forms Forum
Join Tek-Tips® Today!
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
- Talk To Other Members
- Notification Of Responses To Questions
- Favorite Forums One Click Access
- Keyword Search Of All Posts, And More...
Register now while it's still free!
Already a member? Close this window and log in.
Join Us Close