Copy record in the subform if the NoOfPayments value is 2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hrprabhu
    New Member
    • May 2010
    • 83

    Copy record in the subform if the NoOfPayments value is 2

    Got it working a bit, but, have a look at the attachment Please.

    When I input No. Of Payments equals to 2, it is prompting me to input the IDLPA, how do I get around it? It has to pick up the IDLPA automatically.

    Thanks

    Raghu Prabhu
    Attached Files
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1288

    #2
    Is IDLPA the name of a column in a table? Is it spelled correctly? It's asking for the value of that because your select statement includes that but there is no column with that name. It thinks that's the name of a parameter you will supply.

    Jim

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      Please understand, many of us cannot or will not d/l un-requested attachments. This has absolutely nothing to do with who you are... In my case, such d/l are prohibited by my ITSec staff. For many others, it is part of "safe computing/best practices" not to d/l such files. A practical example as to why can be found here http://bytes.com/topic/access/answer...l-ms-products. this unfourtunate Member opened a file from a trusted source and is now haveing all sorts of issues!

      SO, Please, take a few moments to look at your tables, queries, and forms. If you can't find the typo yourself then you can post back with the underlying code and/or VBA script.
      Last edited by zmbd; Mar 27 '14, 08:40 PM.

      Comment

      • hrprabhu
        New Member
        • May 2010
        • 83

        #4
        Thank you sorted out the problem.

        Comment

        • zmbd
          Recognized Expert Moderator Expert
          • Mar 2012
          • 5501

          #5
          Would you mind posting how you solved the issue?

          Comment

          • hrprabhu
            New Member
            • May 2010
            • 83

            #6
            Hi zmbd, here it is ....Just worked it out. I was trying to copy the LPAID too and it was causing the problem. After I realised that then I was finding it was not updating if I input 2 a couple of times.

            Code:
            Private Sub noOfpays_AfterUpdate()
            
                Select Case noOfpays
                    Case 1
                        'do nothing
                    Case 2
                        Me.Dirty = False
                        DoCmd.OpenQuery "Query1", acViewNormal, acEdit
                        Me.Requery
                End Select
                
            End Sub
            This is working now.

            Comment

            • hrprabhu
              New Member
              • May 2010
              • 83

              #7
              Also in the query I have to put this in the criteria for IDLPA

              [Forms]![frmMain]![subFrmLPA].[Form]![IDLPA]

              Thanks zmbd

              Comment

              Working...