Results 1 to 9 of 9
  1. #1
    sperriss is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Posts
    4

    Enter parameter value

    Hi



    I'm new to access but I've created a query where I only want some of the columns in the query to show in the final output. The query works fine but when I uncheck the Show button in the design view for the query it asks for a parmater value. It doesn't do this if I leave the Show button checked. Any ideas why this is and is there a solution. The expression I'm using in the query is : Expr1: IIf([Table1]![Abundance] Between 1 And 9,[Table2]![Cat1],0)

    Thanks

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Certain things you need to include in the SELECT statement. An alias is one of those things. I believe another nuance would be Group On.

    Why do you need the IIf and what are you trying to do with it?

  3. #3
    sperriss is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Posts
    4
    Thanks

    This relates to a score for a 'biotic index'. Basically the value of the index varies according to the abundance. In this case if the abundance was between 1 and 9, the score would be the value of 'cat 1'- the value of this will depend on the individual species. I'm using IIf because I'm used to using if in Excel but I'm sure there are better ways.
    Last edited by June7; 06-27-2014 at 10:44 AM.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Reading the IIf I would think you would want the alias visible and in the SELECT statement. Are you adding criteria to your alias, like WHERE such and such? You can add some criteria and see that the entire IIf will be duplicated in the WHERE Clause. I believe you can include an IIf in the where clause and other places too, without the IIf in the SELECT statement.

  5. #5
    sperriss is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Posts
    4
    Probably doesn't matter in the end- as long as the query works which is seems to. Perhaps you just can't hide columns that have an Iif statement?

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    It is the Alias you created (Expr1

    You created a new field/column in your query.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Why would you calculate this value and then not show it? You don't show any filter parameter applied to the constructed field. If the expression is not part of WHERE clause, why would you even calculate it and then not want to show it? If you don't show it how can it be available for use?

    I just tested creating a field with IIf and unchecking the Show and no filter parameter. No parameter popup prompt and field does not show. But the field also is not saved with the query.

    If I include a filter parameter against the field and uncheck Show then the field is retained but the alias name is dropped.
    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.

  8. #8
    sperriss is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Posts
    4
    This is probably because I'm new to Access and not going about it the right way. The Iif expressions are used to generaste values which are then summed to give the final answer. It's only this final answer that is important, the Iif experssions are only used to help generate this and are not important in themselves.

    Not sure what a WHERE clause is or an 'alias' as I am new to Access.



    Quote Originally Posted by June7 View Post
    Why would you calculate this value and then not show it? You don't show any filter parameter applied to the constructed field. If the expression is not part of WHERE clause, why would you even calculate it and then not want to show it? If you don't show it how can it be available for use?

    I just tested creating a field with IIf and unchecking the Show and no filter parameter. No parameter popup prompt and field does not show. But the field also is not saved with the query.

    If I include a filter parameter against the field and uncheck Show then the field is retained but the alias name is dropped.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    The alias is a fieldname generated for a field created by expression. The WHERE clause is the filter criteria. For instance:

    SELECT [qty] * [price] AS ExtAmt FROM Purchases WHERE PurchaseDate > #1/1/2014#;

    ExtAmt is alias fieldname for the calculation.

    So do not uncheck the Show box for the calculated fields.
    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.

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

Similar Threads

  1. Enter Parameter Value?
    By IzzyKap in forum Forms
    Replies: 3
    Last Post: 12-21-2012, 08:43 AM
  2. Replies: 13
    Last Post: 01-10-2012, 09:56 AM
  3. Enter Parameter Value
    By T001 in forum Access
    Replies: 1
    Last Post: 08-11-2010, 05:43 AM
  4. Enter Parameter Value
    By gutes2 in forum Forms
    Replies: 3
    Last Post: 03-03-2010, 05:03 PM
  5. Enter Parameter Value
    By plesser in forum Access
    Replies: 1
    Last Post: 11-08-2008, 10:27 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