Results 1 to 4 of 4
  1. #1
    Terryb07 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    3

    Query error


    I have the following expression in a query and it keeps asking for Enter Parameter value. ANy ideas?

    Result: IIf(IsNumeric(Staff![Portfolio])=[P&D Manager]!Dept,"Not good","ok")

    Thanks

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    the message should be telling which parameter it is asking for - in this case the implication is either one or both of Staff![Portfolio] or [P&D Manager]!Dept do not exist. Without knowing more about the rest of the query, it is not possible to comment further other than suggest you use the expression builder.

    Other comments
    Your code looks weird - IsNumeric(Staff![Portfolio]) with return either true or false (-1 or 0) - so to get a match [P&D Manager]!Dept needs to be either -1 or 0
    using non alphanumeric characters in your field and table names (i.e. [P&D Manager]) can cause unexpected problems even with using square brackets so best to avoid - it might be causing your issue here
    I'm not sure using "!" as a separator is relevant here, try changing them to "."

  3. #3
    Terryb07 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2015
    Posts
    3
    A little more info here. The main table is called Staff. In it there is a field called P&D Manager and that is a lookup to a table called P&DManager and in it s a list of managers. Obviously teh P&DManaager in the staff table is a a number field, but the P&D Manager in the P&D Manager in the P&D Manager table is text. So when I use the IIF to say if P&D Manager is the same as P&D Manager in the staff table.

    Hope that helps

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    In it there is a field called P&D Manager and that is a lookup to a table called P&DManager and in it s a list of managers
    regret lookups don't work that way - you need to add your P&DManager table to your query. Lookups seem like a great idea initially but actually cause more trouble than they are worth - take a look at this thread http://access.mvps.org/access/lookupfields.htm

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

Similar Threads

  1. Replies: 14
    Last Post: 03-31-2015, 05:20 PM
  2. Replies: 2
    Last Post: 09-10-2014, 11:30 AM
  3. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  4. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  5. Replies: 6
    Last Post: 05-30-2012, 12:32 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