Results 1 to 5 of 5
  1. #1
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125

    Question appropriate on usage of Choose Function

    =Choose([PoliticalPreference],"Democrat","Independent","Non Voter","Tea Party","Republican”)



    I still can't resolve the problem with this code, but I am wondering about its use in a report control source since it doesn't stop with a match, but tests each choice. Seems to me that this would extend the run/print time. Any thoughts on using this function in preference to the other selective Functions? TIA Phil

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Seems like you already know the answer: a related table. I can't remember the last time I used Choose() in an app.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Phil,
    As far as I can tell, the last quote is the wrong quote character:
    Code:
    =Choose([PoliticalPreference],"Democrat","Independent","Non Voter","Tea Party","Republican)
    Try this:
    Code:
    =Choose([PoliticalPreference],"Democrat","Independent","Non Voter","Tea Party","Republican")

  4. #4
    justphilip2003 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ohio
    Posts
    125
    Thanks, I need to look into enlarging my screen print!! I think I also have a data type conflict here. PoliticalReference is assigned a value through an Options Group Button. I learned while playing with another example code that my values were defined as text not numeric in the Table. So I am thinking that Choose will not work here. If I change the table to integer, then my IIf and Switch examples will probably cease to work. TIA Phil

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    If I change the table to integer, then my IIf and Switch examples will probably cease to work.
    They will cease to work until you change the arguments from a "text 1" to a "number 1".

    Text 1 looks like >> "1"
    Number 1 looks like >> 1

    If you have problems, post back.

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

Similar Threads

  1. Nz function question
    By smeghead67 in forum Queries
    Replies: 12
    Last Post: 06-11-2012, 12:54 PM
  2. query function question
    By Daryl2106 in forum Access
    Replies: 1
    Last Post: 02-29-2012, 10:40 PM
  3. function question
    By manic in forum Programming
    Replies: 4
    Last Post: 02-10-2012, 04:14 PM
  4. Long Choose Function
    By Ganymede in forum Access
    Replies: 4
    Last Post: 01-03-2012, 09:41 PM
  5. Question; Count function ..
    By efleming in forum Queries
    Replies: 4
    Last Post: 05-27-2011, 08:05 AM

Tags for this Thread

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