Results 1 to 3 of 3
  1. #1
    srwafa is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2019
    Posts
    7

    Linking Crosstab Query to Parent Subform through Customer ID

    Hi there,



    Ooops Not Parent Subform but Parent Form (My bad)

    I have a Parent Form (below) that navigates through customers. I also have a Crosstab query that Pivots the 4 categories of products that we sell that the customer has bought in during the year analysed by quarter. I want to put the Crosstab in the red square on the right so that the end user may see a summary of sales to customer during the year. Is there a way of linking the Crosstab WHERE Criteria to the Parent Form Customer ID (BP No)

    Click image for larger version. 

Name:	2019-07-06_02-51-05.jpg 
Views:	12 
Size:	93.2 KB 
ID:	39019

    Thank you in advance
    Last edited by srwafa; 07-05-2019 at 07:16 PM. Reason: Incorrect titling

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    What do you want in the red square - a listbox or a subform? Think I would use a listbox.

    The CROSSTAB will have to specify a filter parameter for the customerID and that parameter would be a reference to textbox with the CustomerID. Review http://allenbrowne.com/ser-67.html#Param


    Advise not to use spaces nor punctuation/special characters in naming convention.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    assuming your crosstab recordsource includes customerID as a row heading (does not have to be displayed in the subform) then you can use the linkchild/master properties of the subform control. Or are you taking my advice from your other thread and only returning the data for one specific customer? In which case use June's suggestion or alternatively you can use code in the main form current event along these lines


    me.subformname.form.recordset="SELECT * FROM myXtabQry WHERE BPID=" & me.BPID

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

Similar Threads

  1. Replies: 3
    Last Post: 04-17-2019, 04:47 PM
  2. Parent and subform Linking issue
    By ShaunG in forum Forms
    Replies: 69
    Last Post: 01-14-2018, 07:27 PM
  3. Linking Parent ID Autonumber with subform
    By banpreet in forum Forms
    Replies: 5
    Last Post: 12-19-2016, 02:54 PM
  4. Replies: 3
    Last Post: 11-26-2014, 06:05 PM
  5. Replies: 3
    Last Post: 03-30-2012, 10:50 AM

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