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

My subform getting lock alone guys :O Please help me

100+
P: 222
Hello everybody


I am almost done with my project. I am facing a problem with a primary form on my database

when I enter a form contains 3 subforms it is setting allowadditon = false alone !!!!


When I open this subform alone it is setting allowaddition = true !!!!


What is wrong with it.


I found every word in my code there is no allow addition ...
when I change it from from property as allowaddition = true it is not saving ??!!!!!

PLEASE PLEASE PLEASE help meeeeeeeeeeee :(:( as soon as possible

thank you

WASSIM S DACCACHE
May 9 '08 #1
Share this Question
Share on Google+
6 Replies


missinglinq
Expert 2.5K+
P: 3,532
Your post is somewhat hard to understand, but if the main form has AllowAdditions set to No/False or if the main form is non-updatable, which can be due to a number of factors, the subforms will also be set to No/False, regardless of how they are set up individually.

What is the AllowAdditions set to, and can it be updated?

Linq ;0)>
May 9 '08 #2

100+
P: 222
Your post is somewhat hard to understand, but if the main form has AllowAdditions set to No/False or if the main form is non-updatable, which can be due to a number of factors, the subforms will also be set to No/False, regardless of how they are set up individually.

What is the AllowAdditions set to, and can it be updated?

Linq ;0)>
on the main form is true on the subform is false.
on my subform when I try to update the value to true and I save the form. it will automatically set false when open the form again. !!!!!
NB: also for allowedits and allowdeletion
I read every words on my code there is no allowaddtions = false !!!!

What is wrong with my form !!!!
May 9 '08 #3

Expert Mod 2.5K+
P: 2,545
Hi Wassim. Are you sure you have your facts correct here?? Access cannot and does not arbitrarily change the state of the three settings involved (allow additions, allow edits, and allow deletions). If you have checked that the three properties are all set to yes, there is very little likelihood that Access is changing them to No/False in the main form (unless you have called an event procedure to change them for you).

I would be more inclined to consider that the parent-child field linkage you have set between the main form and subform is incorrect somehow.

You will be able to tell by adding some test code to the main form's On Load event, to display the status of the three properties concerned. I do not know the name of the subform concerned, so you will have to replace the generic name below with the real name:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Dim Subform As Form
  3.   Set Subform = Me.NameOfYourSubform.Form
  4.   MsgBox "Subform status: Additions: " & Subform.AllowAdditions _
  5.   & "; Edits: " & Subform.AllowEdits _
  6.   & "; Deletions: " & Subform.AllowDeletions
  7. End Sub
You will see the properties listed as True or False. Please report back what you see. If the allow edits and allow additions are indeed True, it is a linkage problem.

-Stewart
May 9 '08 #4

100+
P: 222
Hi Wassim. Are you sure you have your facts correct here?? Access cannot and does not arbitrarily change the state of the three settings involved (allow additions, allow edits, and allow deletions). If you have checked that the three properties are all set to yes, there is very little likelihood that Access is changing them to No/False in the main form (unless you have called an event procedure to change them for you).

I would be more inclined to consider that the parent-child field linkage you have set between the main form and subform is incorrect somehow.

You will be able to tell by adding some test code to the main form's On Load event, to display the status of the three properties concerned. I do not know the name of the subform concerned, so you will have to replace the generic name below with the real name:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Dim Subform As Form
  3.   Set Subform = Me.NameOfYourSubform.Form
  4.   MsgBox "Subform status: Additions: " & Subform.AllowAdditions _
  5.   & "; Edits: " & Subform.AllowEdits _
  6.   & "; Deletions: " & Subform.AllowDeletions
  7. End Sub
You will see the properties listed as True or False. Please report back what you see. If the allow edits and allow additions are indeed True, it is a linkage problem.

-Stewart
Dear Stewart

It is addition= true ,edits= true ,deletions=true ;

I tried to make a bottom on the subform and i wrote this command

Expand|Select|Wrap|Line Numbers
  1. me.allowadditions=true
it worked but every time user must click on the button

What is the linkage problem ???


Appreciate your help

Kind regards


WASSIM S DACCACHE
May 9 '08 #5

Expert Mod 2.5K+
P: 2,545
Hi Wassim. As I expected, the subform itself does not appear to be the problem here. Be careful in making assumptions about what is wrong then treating these as facts - incorrect assumptions send us all off on the wrong track.

The test of the three properties clearly demonstrates that the subform is correctly set to allow additions and edits when opened from the main form. These two properties in particular determine whether or not a form is read-only. Your subform itself is fine, and this suggests that the problem lies with the main form or the linkage between the parent controls on the main form and the subform child fields.

If you see no subform record data at all when you open the main form - just blank space - it suggests that there is no match between the linking control value in the main form with the child field values in the subform.

I cannot diagnose this further at this distance without knowing much more than you have provided in the way of detail about the structure of your main form and subform.

However, I suggest you start by looking at what it is that you are linking that is common between the two forms.

I am not sure what you are referring to when you say you placed a button on the subform to set allowadditions to true and 'it worked'; the subform itself, as confirmed by the test I requested you perform, is already set to allow additions.

It could be that your main form is NOT set to allow additions, so please check that the same three properties mentioned are set to Yes for the main form (allow additions and allow edits particularly).

As for being more specific on the linkage issues, you are in a better position than we are to know what fields you are linking between the main form and the subform.

It would be helpful to post the SQL (or a representative subset of it) for the queries on which the main form and subform are based, to get a better idea of what might be wrong, and to see a screenshot of the form itself to get a better idea of its structure and what is happening. You can always zip a screenshot and attach it to your next post (it is done by using the Edit facilities on the posting, then Manage Attachments to upload your zip file).

-Stewart
May 9 '08 #6

100+
P: 222
Hi Wassim. As I expected, the subform itself does not appear to be the problem here. Be careful in making assumptions about what is wrong then treating these as facts - incorrect assumptions send us all off on the wrong track.

The test of the three properties clearly demonstrates that the subform is correctly set to allow additions and edits when opened from the main form. These two properties in particular determine whether or not a form is read-only. Your subform itself is fine, and this suggests that the problem lies with the main form or the linkage between the parent controls on the main form and the subform child fields.

If you see no subform record data at all when you open the main form - just blank space - it suggests that there is no match between the linking control value in the main form with the child field values in the subform.

I cannot diagnose this further at this distance without knowing much more than you have provided in the way of detail about the structure of your main form and subform.

However, I suggest you start by looking at what it is that you are linking that is common between the two forms.

I am not sure what you are referring to when you say you placed a button on the subform to set allowadditions to true and 'it worked'; the subform itself, as confirmed by the test I requested you perform, is already set to allow additions.

It could be that your main form is NOT set to allow additions, so please check that the same three properties mentioned are set to Yes for the main form (allow additions and allow edits particularly).

As for being more specific on the linkage issues, you are in a better position than we are to know what fields you are linking between the main form and the subform.

It would be helpful to post the SQL (or a representative subset of it) for the queries on which the main form and subform are based, to get a better idea of what might be wrong, and to see a screenshot of the form itself to get a better idea of its structure and what is happening. You can always zip a screenshot and attach it to your next post (it is done by using the Edit facilities on the posting, then Manage Attachments to upload your zip file).

-Stewart

Dear Stewart;

I was reading every word in your post. It is great. I found the attribute that he is linked to the main from wasn't included in my sql so once I included the attribute on my subform query it unlocked alone.

I would like to appreciate you for this great information.


Thank you for your support.


Cheers;

WASSIM S DACCACHE
May 9 '08 #7

Post your reply

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