Results 1 to 6 of 6
  1. #1
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122

    Remove Static Reference On Report

    I want to remove this reference, Plants_1.Cultivar from the form, but cant seem to remove it.
    I updated my code :


    Code:
    SELECT tblNursOrders.Nr, Profile.Display, tblNursOrders.Anno, Plants_1.Cultivar, Plants_1.Clone, tblNursOrders.PlantIDRoot, Plants.Cultivar, Plants.Clone, tblNursOrders.PlantIDScion, tblNursOrders.OrderAmount, tblNursOrders.OrderBy, tblNursOrders.Allocated, tblNursOrders.Contract, tblNursOrders.Comment, tblNursOrders.SourceRoot, tblNursOrders.Cerified, tblNursOrders.CertifiedType, tblNursOrders.DeliveryNo, tblNursOrders.DeliveryDate, tblNursOrders.DeliveryQuantity, Profile.Initials, Profile.Surname, Profile.Address, Profile.Town, Profile.Country, Profile.PostCode, Profile.CertNo, tblNursOrders.OrderSize, tblNursOrders.DeliverySizes, tblNursOrders.DeliveryNotePrinted, tblEntToPay.PayTo, tblNursOrders.DeliveryType, tblEntToPay.VatNo, tblNursOrders.SourceScion, tblEntToPay.FinRekNo, tblEntToPay.Vat_103_Received, tblEntToPay.Exemption_from_VAT, Profile.Conditions_of_Sale, tblNursOrders.Nursery, tblEntToPay.VATIDFROM (((Profile INNER JOIN tblNursOrders ON Profile.Nr = tblNursOrders.Nr) INNER JOIN Plants ON tblNursOrders.PlantIDRoot = Plants.PlantID) INNER JOIN Plants AS Plants_1 ON tblNursOrders.PlantIDScion = Plants_1.PlantID) LEFT JOIN tblEntToPay ON tblNursOrders.PayableTo = tblEntToPay.VATID
    WHERE (((tblNursOrders.DeliveryNo)=[Forms]![FrmPrintDeliveryNotesNurs]![Text1]))
    ORDER BY Plants_1.Cultivar, Plants_1.Clone, tblNursOrders.PlantIDRoot;
    
    
    To:
    Code:
    SELECT DISTINCT
        N.Nr,
        P.Display,
        N.Anno,
        Plants_1.Cultivar      AS ScionCultivar,
        Plants_1.Clone         AS ScionClone,
        Plants.Cultivar        AS RootCultivar,
        Plants.Clone           AS RootClone,
        N.PlantIDRoot,
        N.PlantIDScion,
        N.OrderAmount,
        N.OrderSize,
        N.OrderBy,
        N.Allocated,
        N.TreePrice,
        N.Contract,
        N.Comment,
        N.SourceRoot,
        N.Cerified,
        N.CertifiedType,
        N.DeliveryNo,
        N.DeliveryDate,
        N.DeliveryQuantity,
        N.DeliverySizes,
        N.DeliveryNotePrinted,
        P.Initials,
        P.Surname,
        P.Address,
        P.Town,
        P.Country,
        P.PostCode,
        P.CertNo,
        P.Conditions_of_Sale,
        E.PayTo,
        N.DeliveryType,
        E.VatNo,
        E.FinRekNo,
        E.Vat_103_Received,
        E.Exemption_from_VAT,
        N.Nursery,
        E.VATID,
        Format(Nz(N.Allocated,0)*Nz(N.TreePrice,0),"Currency")          AS [Total Tree Cost],
        Format(Nz(N.Allocated,0)*Nz(ScionPP.[Royalty/Levy],0),"Currency") AS [Total Scion Royalty],
        Format(Nz(N.Allocated,0)*Nz(RootPP.[Royalty/Levy],0),"Currency")  AS [Total Root Royalty]
    FROM
        (((((tblNursOrders AS N
            INNER JOIN Plants 
              ON N.PlantIDRoot  = Plants.PlantID)
           INNER JOIN Plants AS Plants_1 
              ON N.PlantIDScion = Plants_1.PlantID)
          LEFT JOIN Profile        AS P  ON P.Nr        = N.Nr)
         LEFT JOIN tblEntToPay     AS E  ON N.PayableTo = E.VATID)
        LEFT JOIN TblPlantsPrices AS RootPP ON N.PlantIDRoot  = RootPP.PlantID)
        LEFT JOIN TblPlantsPrices AS ScionPP ON N.PlantIDScion = ScionPP.PlantID
    WHERE
        N.DeliveryNo = [Forms]![FrmPrintDeliveryNotesNurs]![Text1]
    ORDER BY
        Plants_1.Cultivar,
        Plants_1.Clone,
        N.PlantIDRoot;
    I deleted all boxes from the report. It still refeence that Plants_1.Cultivar. What am i missing?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,551
    One moment it is a form, then a report , which is it ?

    Search for the fieldname in whatever object it actually is.

    Failing that, upload the DB with enough to see the issue and explicit instructions on how to recreate the issue.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    yrstruly is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2024
    Posts
    122
    I did not ask for a sarcastic response, so your comment is unnecessary. This is a forum for asking questions—those who wish to reply are welcome to do so.

    Quote Originally Posted by Welshgasman View Post
    One moment it is a form, then a report , which is it ?

    Search for the fieldname in whatever object it actually is.

    Failing that, upload the DB with enough to see the issue and explicit instructions on how to recreate the issue.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,551
    Ah, now I remember you.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,818
    Will always remember yrstruly. Will not accept what you tell him. Just does his own thing.

  6. #6
    Minty is offline VIP
    Windows 11 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    I'll bite.
    When you say remove the reference, what do you actually mean, as it's still in the underlying query although it's aliased?
    Is the form/report asking for it like a parameter?

    And the question about it being a form or report is relevant, as there is no point having a sort order specified in the query if this a report's record source, it will be completely ignored.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Print Static Material on report from query
    By Laurielou in forum Reports
    Replies: 3
    Last Post: 05-23-2018, 12:49 PM
  2. Replies: 16
    Last Post: 05-08-2017, 04:12 PM
  3. Replies: 8
    Last Post: 10-26-2016, 02:36 PM
  4. Replies: 10
    Last Post: 02-02-2015, 12:03 AM
  5. Replies: 7
    Last Post: 02-25-2014, 03:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums