Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Posts
    22

    Question Unanswered: SQL statements and queries

    This is what I need to do. When the user opens a report a form pops up and asks the user for the required variables which are stored in a table. - not the best way probably but I dont know very much VB. Then the querie uses those values to display the requested information. Is there a SQL statment i can put in the querie that if it the user enters a certain value it will discountinue the use of that statement - i hope that makes sense

    Here is a example of what i want:

    (Select [Division] from [tblVariables]) if [Division] = "all" then dont use this statement

  2. #2
    Join Date
    Jun 2003
    Posts
    22

    Re: SQL statements and queries

    Originally posted by jimslim
    This is what I need to do. When the user opens a report a form pops up and asks the user for the required variables which are stored in a table. - not the best way probably but I dont know very much VB. Then the querie uses those values to display the requested information. Is there a SQL statment i can put in the querie that if it the user enters a certain value it will discountinue the use of that statement - i hope that makes sense

    Here is a example of what i want:

    (Select [Division] from [tblVariables]) if [Division] = "all" then dont use this statement
    Ok i figured that out for anyone that is curious just put your first sql statment in the criteria:

    (Select [Division] from [tblVariables])

    Then in the Or box enter:

    (Select [Division] from [tblVariables]) Is Null

    Now I have another question how can i make a selection on a form so user can make a null entry to a table... I have a combo box where they select their division, that division is then entered into the variable table. Whats the easiest way to have a selection that will allow the user to enter a null value in the tblVariables table under the division heading...?

  3. #3
    Join Date
    Apr 2003
    Location
    Manchester, NH
    Posts
    57
    Why don't you just make the value NULL by default? This way you don't haveto worry about NULL values messing with your db! Just a thought.

    Dalynching

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •