Results 1 to 4 of 4
  1. #1
    d9pierce1 is offline Expert
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776

    SQL Statement, Seeking advice

    Hello All,
    I have the following SQL statement and need to know how to write. I highlighted where the problem is. I need the two ID's to and two Cbo's to work together in the WHERE? I dont know how to write this. Thanks
    Dave



    SELECT [Tbl_Phone].[PhoneID],[Tbl_Phone].[AccountNameID],[Tbl_Phone].[PhoneTypeID],[Tbl_Phone].[PhoneNumber],[Tbl_Phone].[Ext]
    FROM Tbl_Phone
    WHEREAccountNameID,PhonetypeID=[CboAccountNameID],[CboPhonetypeID];

  2. #2
    Join Date
    Apr 2017
    Posts
    1,679
    Code:
    ...WHERE AccountNameID=[CboAccountNameID] AND PhonetypeID=[CboPhonetypeID]

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,976
    Try this

    Code:
    SELECT PhoneID, AccountNameID, PhoneTypeID, PhoneNumber, Ext
    FROM Tbl_Phone 
    WHERE AccountNameID=Forms!YourFormName.CboAccountNameID AND PhonetypeID= Forms!YourFormName.CboPhonetypeID;
    I've removed unnecessary [], added a space after WHERE and fixed the WHERE clause syntax.

    If running this from the form with those controls use the Me. syntax instead
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    d9pierce1 is offline Expert
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    776
    Thank you so much!

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

Similar Threads

  1. Seeking Help Designing Hotel PMS
    By jasgra2015 in forum Database Design
    Replies: 6
    Last Post: 06-10-2018, 09:51 AM
  2. Seeking Relationship Advice
    By kd2017 in forum Database Design
    Replies: 8
    Last Post: 02-06-2018, 05:37 PM
  3. Seeking Table Conversion Advice
    By justphilip2003 in forum Database Design
    Replies: 11
    Last Post: 04-30-2013, 07:48 AM
  4. Replies: 14
    Last Post: 02-08-2013, 03:06 PM
  5. IIF Statement Advice
    By BinHDreW in forum Access
    Replies: 8
    Last Post: 08-31-2011, 06:02 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