If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Creating a Command Button
Hello, I need to create a form that shows information in a read only
fashion. However, I need a command button that allows the form to be edit. How would you create this command? i know access, but not VBA coding. Please help. Thanks! |
#2
|
|||
|
|||
Creating a Command Button
Why not set Allow Edits to No and then the command button to change it to
Yes. You will also need to have On Close set Allow Edits to No. "Yecenia" wrote: Hello, I need to create a form that shows information in a read only fashion. However, I need a command button that allows the form to be edit. How would you create this command? i know access, but not VBA coding. Please help. Thanks! |
#3
|
|||
|
|||
Creating a Command Button
This will set the records to read-only, then allow editing of the current
record when the cmdEditRecord button is clicked. When you move to another record, the read-only status will be re-instituted. Private Sub Form_Current() Me.AllowEdits = False End Sub Private Sub cmdEditRecord_Click() Me.AllowEdits = True End Sub -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200904/1 |
#4
|
|||
|
|||
Creating a Command Button
Changing the setting to not Allow Edit is simple, but how would you create
the button that changes those settings to "yes"? Would you create a Macro? I am not familiar with VBA coding. "KARL DEWEY" wrote: Why not set Allow Edits to No and then the command button to change it to Yes. You will also need to have On Close set Allow Edits to No. "Yecenia" wrote: Hello, I need to create a form that shows information in a read only fashion. However, I need a command button that allows the form to be edit. How would you create this command? i know access, but not VBA coding. Please help. Thanks! |
#5
|
|||
|
|||
Creating a Command Button
I used your suggested code under a command button, but I got an error.
Please excuse lack of VBA skills, but does this command require two command buttons? I've been working closely with access since 2006, but I've never needed to tap into VB or SQL until now. i appreciate your patience. "Linq Adams via AccessMonster.com" wrote: This will set the records to read-only, then allow editing of the current record when the cmdEditRecord button is clicked. When you move to another record, the read-only status will be re-instituted. Private Sub Form_Current() Me.AllowEdits = False End Sub Private Sub cmdEditRecord_Click() Me.AllowEdits = True End Sub -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200904/1 |
#6
|
|||
|
|||
Creating a Command Button
The code "Form_Current" is entered in the VB window for the form's current
event, the other code is for the command button click event... "Yecenia" wrote in message ... I used your suggested code under a command button, but I got an error. Please excuse lack of VBA skills, but does this command require two command buttons? I've been working closely with access since 2006, but I've never needed to tap into VB or SQL until now. i appreciate your patience. "Linq Adams via AccessMonster.com" wrote: This will set the records to read-only, then allow editing of the current record when the cmdEditRecord button is clicked. When you move to another record, the read-only status will be re-instituted. Private Sub Form_Current() Me.AllowEdits = False End Sub Private Sub cmdEditRecord_Click() Me.AllowEdits = True End Sub -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200904/1 |
Thread Tools | |
Display Modes | |
|
|