Results 1 to 2 of 2
  1. #1
    doss13 is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    1

    Parameter query

    Hi



    I've created a parameter query & a form with which to enter the paramters in. I have 8 different boxes in which you can enter parameters. All works fine except one thing - I have a field in my underlying table called 'Weight' so 2 of the boxes in my form are for entering a minimum weight & a maximum weight so you can return a weight range. Not all records in the table have a weight.

    So what I want is to be able to leave weight parameters blank & for the query to return all records within say a date range (put in via other boxes in the form) whether they have a weight or not (I can get it to do this). But I also want to be able to put in a weight range (via min weight & max weight boxes) & for the query to return records where weight is within that range only. At the moment when I put parameters in, the query is returning records within that weight range but also records where no weight is recorded. Is this possible to do? If so, is there a simple way as I'm not familiar with code.

    Many thanks

  2. #2
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    I think a querydef would be an easier solution for you. If you google for MS Access querydefs, I'm sure you'll be able to find alot of examples to show you the syntax, which is very straight-forward.

    Quote Originally Posted by doss13 View Post
    Hi

    I've created a parameter query & a form with which to enter the paramters in. I have 8 different boxes in which you can enter parameters. All works fine except one thing - I have a field in my underlying table called 'Weight' so 2 of the boxes in my form are for entering a minimum weight & a maximum weight so you can return a weight range. Not all records in the table have a weight.

    So what I want is to be able to leave weight parameters blank & for the query to return all records within say a date range (put in via other boxes in the form) whether they have a weight or not (I can get it to do this). But I also want to be able to put in a weight range (via min weight & max weight boxes) & for the query to return records where weight is within that range only. At the moment when I put parameters in, the query is returning records within that weight range but also records where no weight is recorded. Is this possible to do? If so, is there a simple way as I'm not familiar with code.

    Many thanks

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

Similar Threads

  1. How to run parameter query from VBA
    By John Southern in forum Programming
    Replies: 10
    Last Post: 02-07-2014, 02:24 PM
  2. Parameter Query help...
    By daggy in forum Queries
    Replies: 1
    Last Post: 05-11-2010, 01:10 AM
  3. Parameter Query & Wildcard
    By Rick West in forum Queries
    Replies: 8
    Last Post: 12-29-2009, 10:54 AM
  4. Get value typed in for a Parameter query
    By terryvanduzee in forum Forms
    Replies: 1
    Last Post: 10-14-2009, 03:01 AM
  5. Parameter in Crosstab Query
    By RandyG in forum Queries
    Replies: 4
    Last Post: 09-30-2009, 06:40 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