Query criteria based on ASP form selections

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jslssuze
    New Member
    • May 2007
    • 8

    Query criteria based on ASP form selections

    I have medium experience with Access but need help trying to create a query for the following scenario... any and all help will be greatly appreciated!

    A user will select different items on an .asp form ... depending on what they select (i.e. individual, 14 day, worldwide, 40 metre) I need to bring up a policy price.

    Please ... any help with construction of this would be greatly appreciated!\
  • maxamis4
    Recognized Expert Contributor
    • Jan 2007
    • 295

    #2
    It seems like you need desperate help, but what your asking is a bit diffcult to explain to a novice.

    What you need is two tables.

    First table needs to have the name of the policies followed by a number that is unique to each policy (aka autonumber)

    then create a second table with policy information. In this table make sure you have the number that corresponds to that policy. The reason why i say have a different table for the policyinfomrati on is due to the fact that sometimes a policy might have multiple packages. With this method you could list all the packages without jumbling them up together.

    once this is done set a querystring based on the value of the combo box witch will be linked based on the unique id and will submit the query to return the results based on the selection.

    http://www.asp101.com

    good luck
    Originally posted by jslssuze
    I have medium experience with Access but need help trying to create a query for the following scenario... any and all help will be greatly appreciated!

    A user will select different items on an .asp form ... depending on what they select (i.e. individual, 14 day, worldwide, 40 metre) I need to bring up a policy price.

    Please ... any help with construction of this would be greatly appreciated!\

    Comment

    • jslssuze
      New Member
      • May 2007
      • 8

      #3
      I understand the need to have 2 tables and to have them linked through the primary key, that has been done. What I am unsure of is how to write the query based on options chosen on the form.

      Originally posted by maxamis4
      It seems like you need desperate help, but what your asking is a bit diffcult to explain to a novice.

      What you need is two tables.

      First table needs to have the name of the policies followed by a number that is unique to each policy (aka autonumber)

      then create a second table with policy information. In this table make sure you have the number that corresponds to that policy. The reason why i say have a different table for the policyinfomrati on is due to the fact that sometimes a policy might have multiple packages. With this method you could list all the packages without jumbling them up together.

      once this is done set a querystring based on the value of the combo box witch will be linked based on the unique id and will submit the query to return the results based on the selection.

      http://www.asp101.com

      good luck

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Originally posted by jslssuze
        I understand the need to have 2 tables and to have them linked through the primary key, that has been done. What I am unsure of is how to write the query based on options chosen on the form.
        If the query was using criteria from an Access form you would use something like ...

        Code:
        WHERE [FieldName]=[Forms]![FormName]![TextboxName]
        However, I don't know how this would translate using an ASP form. Try asking the question in the ASP forum. They are more likely to be familiar with the syntax.

        Comment

        • maxamis4
          Recognized Expert Contributor
          • Jan 2007
          • 295

          #5
          Did you look at http://www.asp101.com?

          That has all the examples you will need. take a look then let me know if you are still having problems.
          QUOTE=mmccarthy]If the query was using criteria from an Access form you would use something like ...

          Code:
          WHERE [FieldName]=[Forms]![FormName]![TextboxName]
          However, I don't know how this would translate using an ASP form. Try asking the question in the ASP forum. They are more likely to be familiar with the syntax.[/QUOTE]

          Comment

          • maxamis4
            Recognized Expert Contributor
            • Jan 2007
            • 295

            #6
            Code:
            WHERE [FieldName]='" & TextboxName] & "'"
            that would be the asp way, now if you use a session string it would be session(name) instead of text box

            Comment

            Working...