Results 1 to 4 of 4
  1. #1
    ozzy is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    8

    using column count function in a union query

    Hello,



    I made an union query from 3 tables, but 2 field of tables are using column count and column widths functions.
    Since I can not open union query in design view i cannot use this function, i guess i need to use SQL coding.
    Can you please tell me how to use?
    here is my sql view for my union query:
    The fields which uses these functions are "InputMaterial" and "OutputMaterial" ( Column Count 2 \ Column Widths 0;4 )

    SELECT [CcName],[InputMaterial],[OutputMaterial],[ModuleName]
    FROM tbl_ControlAndCommunication

    UNION SELECT [EsName],[InputMaterial],[OutputMaterial],[ModuleName]
    FROM tbl_EnergySaving

    UNION SELECT [EstName],[InputMaterial],[OutputMaterial],[ModuleName]
    FROM tbl_EnergyStoring;


    Another thing is that i want to filter query using combo box in a form so i cant do this either since design view is not usable
    [Forms]![frmModuleSearch]![Combo1]

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Your filter would have to be put in each qry in the union.

    Tho your union qry looks good here, so your col.count functions may be to blame.

  3. #3
    ozzy is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    8
    Thank you for ur answer but, it didnt help me at all.
    i dont know how to code column count function and column width function in this union qry code

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    At first I didn't understand what you meant by having those properties in a query (they would normally be properties of a combo box on a form). Now I wonder if you are using lookup fields? If so, you'd need to include the other table in each appropriate section of your UNION query, and get the desired field from the lookup table. By the way:

    http://access.mvps.org/access/lookupfields.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Count Function in query
    By tjstromquist in forum Queries
    Replies: 1
    Last Post: 04-03-2012, 10:40 AM
  2. Replies: 3
    Last Post: 10-02-2011, 06:47 PM
  3. Date function within a Union Query
    By pmplyons in forum Programming
    Replies: 2
    Last Post: 08-24-2011, 11:33 AM
  4. Count function on query
    By yousillygoose in forum Queries
    Replies: 1
    Last Post: 02-15-2010, 09:58 PM
  5. Query using count function
    By wasim_sono in forum Queries
    Replies: 0
    Last Post: 11-28-2007, 03:16 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