Results 1 to 3 of 3
  1. #1
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776

    RowSource to get two or more values

    Hi all,
    I have again spent most of the day tring to figure this out and going through the web.
    I have tried it 100 different ways and yet I do not have a clue.
    Would be greatful for some assistance...

    The code below works fine to get one AccountTypeID but when I need two or more ID's I dont knwo what the ' " [ ( and all that stuff goes?


    The Code below was just an example of the last thing I have tried....
    I just cant figure out how to combine AccountType= 1 AND AccountType= 4 In WHERE Part

    Code:
    SELECT [qryAccountType].[AccountID], [qryAccountType].[AccountName], [qryAccountType].[AccountTypeID], [qryAccountType].[HelperValue] FROM qryAccountType WHERE [AccountTypeID]=1 AND [AccountTypeID]= 4 ORDER BY [HelperValue];
    Thanks\
    Dave

  2. #2
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Change the AND to OR
    Code:
    WHERE [AccountTypeID]=1 AND [AccountTypeID]= 4
    Code:
    WHERE [AccountTypeID]=1 OR [AccountTypeID]= 4
    You would not say "The truck is a Chevy AND a Ford".
    You could say "The truck is a Chevy OR a Ford".


    "AND" means both conditions MUST be TRUE.

    "OR" means one or the other or both conditions can be TRUE

  3. #3
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Oh my heavens thank you so much\
    I will mark this solved and make a not of this for future use\
    Thanks
    Dave

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

Similar Threads

  1. Set rowsource of combobox
    By diegomarino in forum Access
    Replies: 4
    Last Post: 11-28-2020, 10:16 AM
  2. Multiple Rowsource
    By qazxsw123 in forum Forms
    Replies: 3
    Last Post: 12-18-2018, 01:52 PM
  3. Change rowsource on cbo
    By Tvanduzee in forum Forms
    Replies: 1
    Last Post: 09-27-2012, 02:04 PM
  4. RowSource question
    By ermcc in forum Access
    Replies: 3
    Last Post: 07-11-2012, 08:16 AM
  5. SQL Rowsource
    By DSTR3 in forum Queries
    Replies: 2
    Last Post: 12-06-2010, 11:06 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