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
|
|||
|
|||
Add and Edit
Hi everybody,
I am placing edit button so that unless user presses it he cannot be able to edit records in the form. my problem is if he presses it my form all records in are open for editing. how to change edit modes when user changes to new record. My form contains subform also. so the edit mode should be same for both main and subform with the same button on main form. kindly help. thanks for any help. krish |
#2
|
|||
|
|||
"KRISH" wrote in message
Hi everybody, I am placing edit button so that unless user presses it he cannot be able to edit records in the form. my problem is if he presses it my form all records in are open for editing. how to change edit modes when user changes to new record. My form contains subform also. so the edit mode should be same for both main and subform with the same button on main form. kindly help. thanks for any help. krish You're going to need code both for your command button and for the form's Current event. In its simplest form, it might look like this: Private Sub Form_Current() Me.AllowEdits = False Me!sfMySubformControl.Form.AllowEdits = False End Sub Private Sub cmdEdit_Click() Me.AllowEdits = True Me!sfMySubformControl.Form.AllowEdits = True End Sub (where "sfMySubformControl" is the name of the subform control on the main form, which may or may not be the same as the name of the fom object the subform control displayes) Do you want to allow the user to add new records on this form without having to click the button? Do you want the user to be able to delete records without having to click the button? If you want to control those operations with the button also, you'll need add additional lines to the event procedures to set the AllowAdditions and AllowDeletions properties. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|