Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Posts
    186

    Unanswered: Unexpected parameter in query

    Good morning!

    I have a union query combining data from 2 tables (not select queries) that is a record source in a locked subform, linked on [Account]
    I decided to reformat the date field for this subform view so I made it into a select query with an expression to format date.

    I changed the subform record source from the union query to the select query

    Now when I open the form/subform - I get a parameter box Query1.Account.
    I "OK" by it, and the records that the form shows are exactly what I wanted.

    Can anyone tell me what would prompt this? And is there a way I can get rid of it? I cannot find any references in sql, query design view or form fields.

    THANKS!

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Please post the SQL statements of the query (or queries).
    See: http://www.dbforums.com/microsoft-ac...ml#post4534485
    Have a nice day!

  3. #3
    Join Date
    Jun 2010
    Posts
    186
    UNION QUERY:
    SELECT REGSTAT32511.ID, REGSTAT32511.ACCOUNT, REGSTAT32511.Date, REGSTAT32511.STATLU, REGSTAT32511.STATNOTES, REGSTAT32511.SLU, REGSTAT32511.SLU2, REGSTAT32511.PTLU, REGSTAT32511.RNOTES
    FROM REGSTAT32511
    GROUP BY REGSTAT32511.ID, REGSTAT32511.ACCOUNT, REGSTAT32511.Date, REGSTAT32511.STATLU, REGSTAT32511.STATNOTES, REGSTAT32511.SLU, REGSTAT32511.SLU2, REGSTAT32511.PTLU, REGSTAT32511.RNOTES
    UNION SELECT PROGOULDACCOUNTS11510.ID, PROGOULDACCOUNTS11510.ACCOUNT, PROGOULDACCOUNTS11510.Date, PROGOULDACCOUNTS11510.STATLU, PROGOULDACCOUNTS11510.STATNOTES, PROGOULDACCOUNTS11510.SLU, PROGOULDACCOUNTS11510.SLU2, PROGOULDACCOUNTS11510.PTLU, PROGOULDACCOUNTS11510.RNOTES
    FROM PROGOULDACCOUNTS11510;

    SELECT QUERY:
    SELECT frmViewAcctDetailquery.ID, frmViewAcctDetailquery.ACCOUNT, frmViewAcctDetailquery.Date, frmViewAcctDetailquery.STATLU, frmViewAcctDetailquery.STATNOTES, frmViewAcctDetailquery.SLU, frmViewAcctDetailquery.SLU2, frmViewAcctDetailquery.PTLU, frmViewAcctDetailquery.RNOTES, Format([frmViewAcctDetailquery].[Date],"mm/dd/yy") AS Expr1
    FROM frmViewAcctDetailquery;

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I suppose that the first (Union) query is named "frmViewAcctDetailquery". When you open it can you see a column (field) named "ACCOUNT", and if yes what does it contain?

    Also it would be wise NOT to use "Date" as the name of a field: it's a reserved word in Access, and sooner or later you'll have problems because of it.
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •