By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

Set Allow Edits on a subform

P: 47
Hello,

I am using MS Access 2003 to create an inventory and ordering database. After an order is processed I disable that order by setting the main form's Allow Edits property to false. This effectively prevents the user from changing the details of the order.

The problem shows up when the user gets to a order that has not been processed. The main form is unlocked for the user to edit but the subform and all the controls on the subform remain unusable.

I need to know how to set the subform's allowedits propoerty in code.

Here is what I thought would work but apparently it does not:
Forms![Add an Order and Details].[Order_Details_Subform].AllowEdits = True

Does anyone know how to change the AllowEdits property on a subform? I am trying to do this in the Form_Current() event, in an if statement that evaluates a control on the main form. If the control holds a certain value then AllowEdits on the main form is set to true or false.

Any help is appreciated. Thanks.
May 14 '08 #1
Share this Question
Share on Google+
5 Replies


Expert Mod 2.5K+
P: 2,545
Hi. You are very close with what you had. You just need to refer to the Form property of the subform, and set AllowEdits false (for disallow) or True (to allow):
Expand|Select|Wrap|Line Numbers
  1. Forms![Add an Order and Details].[Order_Details_Subform].Form.AllowEdits = False
If you are referring to the subform from within the main form (from event code, for example) you can use the Me property to shorten the above to
Expand|Select|Wrap|Line Numbers
  1. Me![Order_Details_Subform].Form.AllowEdits = False
-Stewart
May 14 '08 #2

100+
P: 222
Hello,

I am using MS Access 2003 to create an inventory and ordering database. After an order is processed I disable that order by setting the main form's Allow Edits property to false. This effectively prevents the user from changing the details of the order.

The problem shows up when the user gets to a order that has not been processed. The main form is unlocked for the user to edit but the subform and all the controls on the subform remain unusable.


I need to know how to set the subform's allowedits propoerty in code.

Here is what I thought would work but apparently it does not:
Forms![Add an Order and Details].[Order_Details_Subform].AllowEdits = True

Does anyone know how to change the AllowEdits property on a subform? I am trying to do this in the Form_Current() event, in an if statement that evaluates a control on the main form. If the control holds a certain value then AllowEdits on the main form is set to true or false.

Any help is appreciated. Thanks.
I think you have to write this code
me.order_details_subform.allowedits=true

please try it and tell me if it works... If it doesn't I'll leave this subject to the expert.

Have a nice day
May 14 '08 #3

Expert Mod 2.5K+
P: 2,545
Hi Wassim. AllowEdits is a property of the Form object. To refer to the subform's Form properties requires a qualification that would not be needed if it was the main form's Allow Edits that was being changed. Unfortunately what you have advised is the same (except for the use of the Me shortcut) as the original poster has already tried, and this will not succeed when applied to a subform unless the Form qualifier is used.

-Stewart
I think you have to write this code
me.order_details_subform.allowedits=true

please try it and tell me if it works... If it doesn't I'll leave this subject to the expert.

Have a nice day
May 14 '08 #4

P: 47
Got it! Thanks for the help and quick response!
May 14 '08 #5

P: 1
Thank you for the help. I had that problem too :)
Oct 21 '15 #6

Post your reply

Sign in to post your reply or Sign up for a free account.