×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • 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.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Locking and Unlocking Forms

Locking and Unlocking Forms

Locking and Unlocking Forms

(OP)
Hello,

I have a form with a subform in it.  I want that when a user opens the form, that everything should be locked.  When the user wants to input new data, they would click on the [Add] command button, which will unlock all the fields.  Also, if the user wants to edit existing data, they would click on the [Edit] command button, which opens up another form which asks for the user's name and the current date.  When the user enters this, and clicks the [Okay] button, I want the previous form to unlock.  I also have two fields which when clicked on have a pop-up calendar.  Just something to add.  

I am new to this forum, and I'm not sure if I posted my question in the right forum.

I would appreciate any help with this.  If you need any further information, please let me know.

RE: Locking and Unlocking Forms

Welcome to Tek-Tips..
 Tell me what db you are using.. Is it MS Access?

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials

RE: Locking and Unlocking Forms

(OP)
I'm sorry, I didn't mention that did I.  Yes, its access.  I am getting my feet wet with a little VBA also with this database.

RE: Locking and Unlocking Forms

Don't worry..
Here are the Acces Forums in TEK-TIPS
Microsoft: Access Forms Forum
Microsoft: Access Modules (VBA Coding) Forum
Microsoft: Access Queries and JET SQL Forum
Microsoft: Access Reports Forum
Microsoft: Access Tables and Relationships Forum
Microsoft: Access Other topics Forum
Microsoft: Access Project (ADP) Forum
Here are some simple code for command buttons. command names are self descriptive..

CODE

Private Sub cmdAddNew_Click()
    DoCmd.GoToRecord , , acNewRec
End Sub

CODE

Private Sub cmdEditRecord_Click()
    Me.AllowEdits = True
End Sub

CODE

Private Sub cmdLockForm_Click()
    Me.AllowEdits = False
End Sub
Please come back if you need more help

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials

RE: Locking and Unlocking Forms

(OP)
Thanks for your code.  I will work on it now.  Do I post my question in a more appropriate forum if I keep having problems?

RE: Locking and Unlocking Forms

Yes.. You will get faster and better answers for common/unique problems

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials

RE: Locking and Unlocking Forms

(OP)
Thanks for your help.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close