Adding additional requirements to an access query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • trixxnixon
    New Member
    • Sep 2008
    • 98

    Adding additional requirements to an access query

    ok i have a query that pulls its parameters from a form. If a filed on the parameter form is blank, or is null, the query will search without using a parameter. To do this I use the
    Code:
     [Forms]![frm_Reporting]![Specialist] or ([Forms]![frm_Reporting]![Specialist]is null)
    when I save the query and re open it, access creates a few extra fields and expands itself to add the formula in several places.

    The problem is, that when I decide to include another field parameter in the query, the results are not restricted by the new field.
    Is there something I can do to make the query effectively incorporate the new addition, or would it be necessary to add the new parameter via a sql statement?
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    It's difficult to tell what's going on. Can you change your query view to sql and post the full sql for the query. That way it will be easier to follow.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32656

      #3
      This is always tricky Trixx :)

      A technique I tend to use is to use Nz() to return a value to replace Null which has a meaning (in the context) of all records. For instance, assuming your Specialist value is a string and reflects a person's name, then something like :
      Code:
      [Specialist] Like Nz([Forms]![frm_Reporting]![Specialist],'*')
      The format varies for different requirements though. This one would be no good at all for a numeric field.

      PS. Nice to see you back :)

      Comment

      Working...