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

Locking and Unlocking Forms

Status
Not open for further replies.

TriniGal

Programmer
Sep 28, 2005
84
US
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.
 
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
 
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.
 
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
 
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?
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top