Current Record query from subform not working help!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ZKAHADI
    New Member
    • Aug 2020
    • 58

    Current Record query from subform not working help!!

    i created an append query in which i need current to be append into another table.
    SQL
    Code:
    INSERT INTO PaidFeeT ( FacultyPaid, MonthYearPaid, SecurityFeePaid, AdmissionFeePaid, TotalFeePaid, SR )
    SELECT FeeT.Faculty, FeeT.MonthYear, FeeT.Security, FeeT.AdmissionFee, FeeT.TotalFee, FeeT.ID
    FROM FeeT
    WHERE (((FeeT.SR)=[forms]![FeeTF]![SR]));
    from the form its working but from subform its not working it showing enter parameter. see image
  • cactusdata
    Recognized Expert New Member
    • Aug 2007
    • 223

    #2
    Try with:

    Code:
    WHERE FeeT.SR=[Forms]![FeeTF].[Form]![SR];
    But it would be much simpler to open the RecordsetClone of the subform as a recordset, and then use AddNew to insert the record. It would even update the subform automagically.

    Comment

    • ZKAHADI
      New Member
      • Aug 2020
      • 58

      #3
      how should i do this? clone record

      Comment

      • cactusdata
        Recognized Expert New Member
        • Aug 2007
        • 223

        #4
        That could be something like:

        Code:
        Dim Source  As DAO.Recordset
        Dim Target  As DAO.Recordset
        
        Set Source = Me!NameOfYourSubformControlHoldingFeeT.Form.RecordsetClone
        Set Target = Me!NameOfYourSubformControlHoldingPaidFeeT.Form.RecordsetClone
        
        Source.FindFirst "SR = " & Me!NameOfYourSubformControlHoldingFeeT.Form!SR.Value
        If Not Source.NoMatch Then
            Target.AddNew
                Target!FacultyPaid.Value = Source!Faculty.Value
                Target!MonthYearPaid.Value = Source!MonthYear.Value
                Target!SecurityFeePaid.Value = Source!Security.Value
                Target!AdmissionFeePaid.Value = Source!AdmissionFee.Value
                Target!TotalFeePaid.Value = Source!TotalFee.Value
                Target!SR.Value = Source!ID.Value
            Target.Update
        End If
        Target.Close
        Source.Close

        Comment

        • isladogs
          Recognized Expert Moderator Contributor
          • Jul 2007
          • 479

          #5
          For info, the OP has since cross posted this same thread at another forum

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            Well, what you get out of something is generally related to what you put in. The answer's there if they want to work on understanding it. If not then they'll have the same problems wherever they go.

            We (Bytes.com) have a question and an answer and that gives value, both to the site and any others who are interested in similar questions.

            To be fair, there's no reason why members shouldn't be members elsewhere too. We just need to ensure our answers are as good as they can find - or at least as good as we can make them. I suspect we do a decent job in that respect from the feedback I've heard.

            Well done to all of you for providing those answers :-)

            PS. I just read the linked link. I have to say I accept much of what Ken says and agree with it. I'm a little ambivalent about some of his suggestions but nothing majorly. Many of our best experts post cross-sites and that's great. Not all do though.
            Last edited by NeoPa; Apr 7 '21, 09:43 PM.

            Comment

            • isladogs
              Recognized Expert Moderator Contributor
              • Jul 2007
              • 479

              #7
              AFAIAC its fine to post the same question at more than one forum PROVIDING the OP has the courtesy to say that he/she has done so and provide the link(s) to the other thread(s).
              However doing so without providing that information wastes everyone's time...at each of the forums

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32633

                #8
                I would agree with that - with the proviso that any such links don't break the rules of the site you're posting on.

                I haven't seen any public announcement yet but I'm certainly aware Niheel (Owner) is planning to relax such restrictions here pretty soon.

                Comment

                • ZKAHADI
                  New Member
                  • Aug 2020
                  • 58

                  #9
                  is there any problem if someone get any satisfied answer from this or other form? i think its not a religious form where i ask any solution from one religion and another.

                  Comment

                  • cactusdata
                    Recognized Expert New Member
                    • Aug 2007
                    • 223

                    #10
                    No. I've also posted questions in two fora that were marginal to the core expertise of these fora.

                    But, when a solution is found, it should be referred to in the other forum/fora, as no forum like abandoned questions.
                    The trouble, that may prevent you from this, is that some fora doesn't allow links to other fora as these are seen as competitors (which I've never understood as no two fora have the some focus).
                    If so, you should copy the full solution to the other fora.

                    Comment

                    • isladogs
                      Recognized Expert Moderator Contributor
                      • Jul 2007
                      • 479

                      #11
                      @Zhakadi
                      The fact that you asked the question in post #9 suggests you didn't read the link I provided at the other forum.
                      So I'll provide it again here: A message to forum cross posters.

                      Comment

                      • NeoPa
                        Recognized Expert Moderator MVP
                        • Oct 2006
                        • 32633

                        #12
                        Originally posted by ZKAHADI
                        ZKAHADI:
                        is there any problem if someone get any satisfied answer from this or other form? i think its not a religious form where i ask any solution from one religion and another.
                        I'm sorry that you don't understand why your behaviour is considered to be selfish and disrespectful. Nevertheless that is the case.

                        Those that struggle to understand are generally people who have no difficulty with the idea of letting others do their work for them and struggle with any concept of responsibility.

                        It's unfortunate, but doesn't break site rules. Thus we don't take action against such behaviour or members that exhibit it. However, you should be aware that experts everywhere are generally the least dim people, so recognise such behaviour and tend to steer clear of such members when it comes to the time when their expertise is required.

                        You may just find, when you behave in a disrespectful way to those you rely on to help you, that nobody wants to waste their time on your questions.

                        Comment

                        • ZKAHADI
                          New Member
                          • Aug 2020
                          • 58

                          #13
                          i am a learner and i want to learn everywhere. i am not disrespect, i respect all of you because i am as student and your are as teacher. but in search of a batter answer i post my problem on every form.

                          i am really sorry if you or anybody hurt.

                          Comment

                          • NeoPa
                            Recognized Expert Moderator MVP
                            • Oct 2006
                            • 32633

                            #14
                            It may be also that you struggle to understand because you're trying to work in a foreign language. We should allow you some leeway for that. It's easy to forget how hard that can be for those of us that don't need to - and even for those who have to do so but are more practised at it (Some of our experts are not native English speakers either).

                            So, we understand that you are behaving well as you see it. Please follow the link (A message to forum cross posters) posted by IslaDogs earlier and try to understand how you can post in multiple forums without upsetting people.

                            Comment

                            • ZKAHADI
                              New Member
                              • Aug 2020
                              • 58

                              #15
                              i apologize about that but you can see my english also weak. i cant properly speak english. may be my method to talk is not good. but i respect all of you.

                              Comment

                              Working...