In need of a field population to activate a Subform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • VBChallenged
    New Member
    • May 2008
    • 4

    In need of a field population to activate a Subform

    Ok, I am working on an Access DB (2002) that needs to show a Subform when a field is populated with a number. In this case when VendorNumber is populated and it does not match the criteria of [Preconversion] and [Letter] and [VatCompliant] =true, then I want the subform to open up with the information. The link between the form and the VendorNumber is VENID.

    I have tried to use a bunch of queries but it has not given me any joy. So I figure VB will have to be the way to go.
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Can you show us what have you done so far?

    Rey Sean

    Comment

    • VBChallenged
      New Member
      • May 2008
      • 4

      #3
      OK So far I have done the following:

      IIf([VATCompliance_t bl]![PreConversion] Or [VATCompliance_t bl]![Letter] Or [VATCompliance_t bl]![VATCompliant] = YES), “”, check INVID and 1st letter sent.

      Iif ( [VATCompliance_t bl]![PreConversion] and [VATCompliance_t bl]![Letter] and [VATCompliance_t bl]![VATCompliant] = False ),


      Expr1: IIf(([VATCompliance_t bl]![PreConversion] And [VATCompliance_t bl]![Letter] And [VATCompliance_t bl]![VATCompliant]=False),[Forms]![VATCompliance_f rm].[OnQuery],Null)

      EXPR3: IIf([VATCompliance_t bl]![VATCompliant] And [VATCompliance_t bl]![PreConversion] And [VATCompliance_t bl]![Letter]="",[InvoiceTracking W/Sum_qry]![INVID],[InvoiceTracking _tbl]![VendorNumber])

      EXPR4: IIf([Test VATOutstanding Query]![PreConversion] Or [Test VATOutstanding Query]![Letter] Or [Test VATOutstanding Query]![VATCompliant]=True,"",[Test VATOutstanding Query]![INVID])

      EXPR5: IIf([VATCompliance_t bl]![VATCompliant] Or [VATCompliance_t bl]![PreConversion] Or [VATCompliance_t bl]![Letter]=True,"",[InvoiceTracking W/Sum_qry]![INVID])

      INVID: (SELECT [INVID] FROM [InvoiceTracking W/Sum_qry] WHERE [VATCompliance_t bl]![VATCompliant] And [VATCompliance_t bl]![PreConversion] And [VATCompliance_t bl]![Letter]="")

      Comment

      • VBChallenged
        New Member
        • May 2008
        • 4

        #4
        I have had this going around in my head for days now. Trying to get the correct way to do this. I tried to cut and paste my DB in here but it would not. Not sure how to show you guys everything.
        This is all new to me.

        Comment

        • VBChallenged
          New Member
          • May 2008
          • 4

          #5
          Here goes the explanation, When the VendorNumber is populated and the statement [preconversion] and [letter] and [vatcompliant] = False I would like the subform to populate with only the information that is in my query VATOutstanding. For that to happen I would need the to use INVID to link the tables / querys VATOutstanding_ qry, InvoiceTracking W/Sum_qry. The problem is right now I do not have the VATOutstanding_ qry working right now as the final table VATOutstanding_ tbl doesn’t have anything in it.

          I wanted to run a series of queries,
          If [preconversion] and [letter] and [vatcompliant] = False then enter INVID

          If INVID matches in VATOutstanding_ tbl populate form

          If VATOutstanding_ tbl is populated then match with INVID and VendorNumber in InvoiceTracking _qry

          If all of the above happens then populate the subform so we can check what other invoices are out there that are not VAT Compliant.

          If we get an invoice that matches the criteria in the subform we can check that we matched it with a check box so that this line will not come up again when the vendornumber is populated next.

          Does any of this make any sense?

          Comment

          Working...