Results 1 to 5 of 5
  1. #1
    jclausen is offline Novice
    Windows 7 Access 2003
    Join Date
    Dec 2010
    Posts
    7

    Not In statement from textbox - help please

    Hello,



    I have a report in which I am using a Not In statement in SQL view.
    This report displays all values from the ABSTRACT field in the ABSTRACTS table except the ones in the Not In statement. The ABSTRACTS field type is a number.

    Code:
    Not In (1173,743)
    This works fine, but I want to have the Not In statement get its info from a textbox named EXCLUDE on the form LEASE_INFO_INPUT. So I tried:

    Code:
    Not In ([Forms]![LEASE_INFO_INPUT]![EXCLUDE])
    This didn't work. If I only put one value in it like: 1173 then it will display all but 1173. If I put two values in it like : 1173,743 then it will display all. I am obviously missing something here.

    Thanks a bunch,
    John

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    This probably wont work but give it a try:

    Not in ( & Forms!LEASE_INFO_INPUT!EXCLUDE & )

  3. #3
    jclausen is offline Novice
    Windows 7 Access 2003
    Join Date
    Dec 2010
    Posts
    7
    Thanks for the quick response... You were right, it didn't work.

    I got an error message : "The expression you entered has too many closing parentheses."

    I didn't see too many...

    Thanks again,
    John

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    I dont know =/

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Please post you entire SQL

    You can't mix SQL and vba syntax. If you're running SQL from vba you need the proper syntax.

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

Similar Threads

  1. Textbox IIF statement not working
    By jgelpi16 in forum Forms
    Replies: 2
    Last Post: 08-22-2010, 08:41 PM
  2. using textbox with In () in query
    By TheShabz in forum Forms
    Replies: 4
    Last Post: 04-10-2010, 12:00 PM
  3. Replies: 1
    Last Post: 11-26-2009, 01:09 PM
  4. change() on the textbox
    By skywalker in forum Forms
    Replies: 0
    Last Post: 03-01-2009, 01:28 AM
  5. total in textbox
    By micfly in forum Access
    Replies: 3
    Last Post: 11-09-2008, 11:24 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