Results 1 to 5 of 5
  1. #1
    sandordan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2018
    Posts
    6

    In case of empty formular get all the values

    Hi Everyone,



    I would like to set a predefined value (all) in my query as criteria in case of the forms value is empty. If I tried with a value instead of "*" I have no problem with the query but at the using "*" I receive no values. I tried "nz" and "if" forms.

    Code:
    If([Formulare]![Produktionsumsatz]![werk]<>"";[Formulare]![Produktionsumsatz]![werk];"*")
    nz([Formulare]![Produktionsumsatz]![werk];"*")

    with like and without like, with value instead of "*" has no problem.

    How can I give a criteria to get all value if I have no value in the Formular?

    Thank you in advance.

  2. #2
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    Use [Formulare]![Produktionsumsatz]![werk] Or [Formulare]![Produktionsumsatz]![werk] is Null in the criteria.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    sandordan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2018
    Posts
    6
    I used

    Code:
    If([Formulare]![Produktionsumsatz]![werk] Is Null;"*";[Formulare]![Produktionsumsatz]![werk])
    no results

  4. #4
    sandordan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2018
    Posts
    6
    and now

    Code:
    if([Formulare]![Produktionsumsatz]![werk] Is Null;Is Null;[Formulare]![Produktionsumsatz]![werk])
    also without results

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Per Minty's suggestion, no If and no semi-colons:

    WHERE [your field name here] = [Formulare]![Produktionsumsatz]![werk] Or [Formulare]![Produktionsumsatz]![werk] Is Null;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 10-16-2016, 12:54 PM
  2. Replies: 12
    Last Post: 10-22-2014, 02:11 PM
  3. Replies: 1
    Last Post: 11-29-2011, 02:17 PM
  4. make textbox lookup values case insensitive
    By sephiroth2906 in forum Forms
    Replies: 2
    Last Post: 04-22-2011, 10:36 AM
  5. CurrentUser dependent data in formular
    By Patience in forum Access
    Replies: 1
    Last Post: 05-11-2010, 12:26 PM

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