My subform getting lock alone guys :O Please help me

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wassimdaccache
    New Member
    • Apr 2007
    • 222

    My subform getting lock alone guys :O Please help me

    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
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    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)>

    Comment

    • wassimdaccache
      New Member
      • Apr 2007
      • 222

      #3
      Originally posted by missinglinq
      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 !!!!

      Comment

      • Stewart Ross
        Recognized Expert Moderator Specialist
        • Feb 2008
        • 2545

        #4
        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:
        [code=vb]Private Sub Form_Load()
        Dim Subform As Form
        Set Subform = Me.NameOfYourSu bform.Form
        MsgBox "Subform status: Additions: " & Subform.AllowAd ditions _
        & "; Edits: " & Subform.AllowEd its _
        & "; Deletions: " & Subform.AllowDe letions
        End Sub[/code]
        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

        Comment

        • wassimdaccache
          New Member
          • Apr 2007
          • 222

          #5
          Originally posted by Stewart Ross Inverness
          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:
          [code=vb]Private Sub Form_Load()
          Dim Subform As Form
          Set Subform = Me.NameOfYourSu bform.Form
          MsgBox "Subform status: Additions: " & Subform.AllowAd ditions _
          & "; Edits: " & Subform.AllowEd its _
          & "; Deletions: " & Subform.AllowDe letions
          End Sub[/code]
          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

          Code:
          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

          Comment

          • Stewart Ross
            Recognized Expert Moderator Specialist
            • Feb 2008
            • 2545

            #6
            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

            Comment

            • wassimdaccache
              New Member
              • Apr 2007
              • 222

              #7
              Originally posted by Stewart Ross Inverness
              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

              Comment

              Working...