A general "How would you code this" question.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brave

    A general "How would you code this" question.

    I am hoping for a code example of how to do this, and hopefully it will
    help me to see an easy way to code what seems to be a huge monster.

    I need to create a form that has two pulldown menues (field names
    Option1 and Option2). Each will house a list of the 50 U.S. States.
    Users would then be able to choose two states, and get a listing for a
    courier used for pickup\deliveri es (exp: My order is in Ohio, but I
    need it delivered to Maine. Who do I use?)

    I am not as familiar with code as I would like, but it seems I would
    need something like this:

    If option1 = this, and option2 = this, then the answer (field name
    Result) = this

    I know that looks stupid, but I am hoping to show you how I am
    approching this in my head.

    Any ideas on how you would approch this project would be great. If you
    could offer a sample of code, I'm sure I could use it as a template for
    other projects. My idea is that this is just standard IF this THEN that
    coding, but I don't know the basics enough to create the code from
    scratch.

    Thanks for any time you can give.

  • Slim

    #2
    Re: A general "How would you code this" question.


    "Brave" <bravesplace@ya hoo.comwrote in message
    news:1162823689 .348528.67130@e 3g2000cwe.googl egroups.com...
    >I am hoping for a code example of how to do this, and hopefully it will
    help me to see an easy way to code what seems to be a huge monster.
    >
    I need to create a form that has two pulldown menues (field names
    Option1 and Option2). Each will house a list of the 50 U.S. States.
    Users would then be able to choose two states, and get a listing for a
    courier used for pickup\deliveri es (exp: My order is in Ohio, but I
    need it delivered to Maine. Who do I use?)
    >
    I am not as familiar with code as I would like, but it seems I would
    need something like this:
    >
    If option1 = this, and option2 = this, then the answer (field name
    Result) = this

    choosing the states and then submitting the form would give you the 2
    values. that is the easy part.
    Now how do you expect to select the best courier from this information?

    You would need some sort of lookup table.


    >
    I know that looks stupid, but I am hoping to show you how I am
    approching this in my head.
    >
    Any ideas on how you would approch this project would be great. If you
    could offer a sample of code, I'm sure I could use it as a template for
    other projects. My idea is that this is just standard IF this THEN that
    coding, but I don't know the basics enough to create the code from
    scratch.
    >
    Thanks for any time you can give.
    >

    Comment

    • Brave

      #3
      Re: A general &quot;How would you code this&quot; question.

      Thanks for the reply. I will be given an excel sheet that shows (much
      like looking at a map) what courier is used.

      States are listed down the side and accross the top of the excel sheet.
      (exp: Ohio and Maine = UPS)

      On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
      "Brave" <bravespl...@ya hoo.comwrote in messagenews:116 2823689.348528. 67130@e3g2000cw e.googlegroups. com...
      >
      I am hoping for a code example of how to do this, and hopefully it will
      help me to see an easy way to code what seems to be a huge monster.
      >
      I need to create a form that has two pulldown menues (field names
      Option1 and Option2). Each will house a list of the 50 U.S. States.
      Users would then be able to choose two states, and get a listing for a
      courier used for pickup\deliveri es (exp: My order is in Ohio, but I
      need it delivered to Maine. Who do I use?)
      >
      I am not as familiar with code as I would like, but it seems I would
      need something like this:
      >
      If option1 = this, and option2 = this, then the answer (field name
      Result) = thischoosing the states and then submitting the form would give you the 2
      values. that is the easy part.
      Now how do you expect to select the best courier from this information?
      >
      You would need some sort of lookup table.
      >
      >
      >
      >
      >
      I know that looks stupid, but I am hoping to show you how I am
      approching this in my head.
      >
      Any ideas on how you would approch this project would be great. If you
      could offer a sample of code, I'm sure I could use it as a template for
      other projects. My idea is that this is just standard IF this THEN that
      coding, but I don't know the basics enough to create the code from
      scratch.
      >
      Thanks for any time you can give.- Hide quoted text -- Show quoted text -

      Comment

      • Slim

        #4
        Re: A general &quot;How would you code this&quot; question.


        "Brave" <bravesplace@ya hoo.comwrote in message
        news:1162825517 .498927.200970@ e3g2000cwe.goog legroups.com...
        Thanks for the reply. I will be given an excel sheet that shows (much
        like looking at a map) what courier is used.
        >
        States are listed down the side and accross the top of the excel sheet.
        (exp: Ohio and Maine = UPS)
        >

        ok
        well i would load the data into a database, but you can read straight from
        the excel file also.

        you need to make a connection to the data

        then use a SQL query to select the answere and reder it to the client.

        do you know how to make a connection to a excel sheet?

        do you know how to make a SQL query?



        On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
        >"Brave" <bravespl...@ya hoo.comwrote in
        >messagenews:11 62823689.348528 .67130@e3g2000c we.googlegroups .com...
        >>
        >I am hoping for a code example of how to do this, and hopefully it will
        help me to see an easy way to code what seems to be a huge monster.
        >>
        I need to create a form that has two pulldown menues (field names
        Option1 and Option2). Each will house a list of the 50 U.S. States.
        Users would then be able to choose two states, and get a listing for a
        courier used for pickup\deliveri es (exp: My order is in Ohio, but I
        need it delivered to Maine. Who do I use?)
        >>
        I am not as familiar with code as I would like, but it seems I would
        need something like this:
        >>
        If option1 = this, and option2 = this, then the answer (field name
        Result) = thischoosing the states and then submitting the form would
        give you the 2
        >values. that is the easy part.
        >Now how do you expect to select the best courier from this information?
        >>
        >You would need some sort of lookup table.
        >>
        >>
        >>
        >>
        >>
        I know that looks stupid, but I am hoping to show you how I am
        approching this in my head.
        >>
        Any ideas on how you would approch this project would be great. If you
        could offer a sample of code, I'm sure I could use it as a template for
        other projects. My idea is that this is just standard IF this THEN that
        coding, but I don't know the basics enough to create the code from
        scratch.
        >>
        Thanks for any time you can give.- Hide quoted text -- Show quoted
        text -
        >

        Comment

        • Brave

          #5
          Re: A general &quot;How would you code this&quot; question.

          I have done some simple update queries, but nothing very advanced. I
          have never connected to an excel sheet

          Here is an example of a connection to an MS Access db I did. Would it
          structure itself in a similar way?

          <%
          Set Conn = Server.CreateOb ject("ADODB.Con nection")
          Conn.Open "driver={Micros oft Access Driver
          (*.mdb)};;DBQ=\ \*********Path to database******* .mdb;"
          mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
          Conn.Execute(my SQL)
          Conn.Close
          Set Conn = Nothing
          %>


          On Nov 6, 11:39 am, "Slim" <m...@here.comw rote:
          "Brave" <bravespl...@ya hoo.comwrote in messagenews:116 2825517.498927. 200970@e3g2000c we.googlegroups .com...
          >
          Thanks for the reply. I will be given an excel sheet that shows (much
          like looking at a map) what courier is used.
          >
          States are listed down the side and accross the top of the excel sheet.
          (exp: Ohio and Maine = UPS)ok
          well i would load the data into a database, but you can read straight from
          the excel file also.
          >
          you need to make a connection to the data
          >
          then use a SQL query to select the answere and reder it to the client.
          >
          do you know how to make a connection to a excel sheet?
          >
          do you know how to make a SQL query?
          >
          >
          >
          On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
          "Brave" <bravespl...@ya hoo.comwrote in
          messagenews:116 2823689.348528. 67130@e3g2000cw e.googlegroups. com...
          >
          I am hoping for a code example of how to do this, and hopefully it will
          help me to see an easy way to code what seems to be a huge monster.
          >
          I need to create a form that has two pulldown menues (field names
          Option1 and Option2). Each will house a list of the 50 U.S. States.
          Users would then be able to choose two states, and get a listing for a
          courier used for pickup\deliveri es (exp: My order is in Ohio, but I
          need it delivered to Maine. Who do I use?)
          >
          I am not as familiar with code as I would like, but it seems I would
          need something like this:
          >
          If option1 = this, and option2 = this, then the answer (field name
          Result) = thischoosing the states and then submitting the form would
          give you the 2
          values. that is the easy part.
          Now how do you expect to select the best courier from this information?
          >
          You would need some sort of lookup table.
          >
          I know that looks stupid, but I am hoping to show you how I am
          approching this in my head.
          >
          Any ideas on how you would approch this project would be great. If you
          could offer a sample of code, I'm sure I could use it as a template for
          other projects. My idea is that this is just standard IF this THEN that
          coding, but I don't know the basics enough to create the code from
          scratch.
          >
          Thanks for any time you can give.- Hide quoted text -- Show quoted
          text -- Hide quoted text -- Show quoted text -

          Comment

          • Mike Brind

            #6
            Re: A general &quot;How would you code this&quot; question.

            Hmmm. For connecting to Access, you are better off using the OLEDB driver
            rather than the ODBC driver in your example

            Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=\somepat h\mydb.mdb;

            Excel is pretty much the same:

            Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
            Source=Fullpath \MyExcel.xls;Ex tended Properties=""Ex cel
            8.0;HDR=Yes;IME X=1"""

            HDR=Yes indicates that the worksheet has a header row. Remove IMEX=1 if you
            want to write to the worksheet.

            sql="SELECT field1, field2 FROM [Sheet1$]" is an example select statement.
            Notice that the worksheet name is followed by a $ sign.

            --
            Mike Brind


            "Brave" <bravesplace@ya hoo.comwrote in message
            news:1162834585 .655392.19000@m 7g2000cwm.googl egroups.com...
            >I have done some simple update queries, but nothing very advanced. I
            have never connected to an excel sheet
            >
            Here is an example of a connection to an MS Access db I did. Would it
            structure itself in a similar way?
            >
            <%
            Set Conn = Server.CreateOb ject("ADODB.Con nection")
            Conn.Open "driver={Micros oft Access Driver
            (*.mdb)};;DBQ=\ \*********Path to database******* .mdb;"
            mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
            Conn.Execute(my SQL)
            Conn.Close
            Set Conn = Nothing
            %>
            >
            >
            On Nov 6, 11:39 am, "Slim" <m...@here.comw rote:
            >"Brave" <bravespl...@ya hoo.comwrote in
            >messagenews:11 62825517.498927 .200970@e3g2000 cwe.googlegroup s.com...
            >>
            Thanks for the reply. I will be given an excel sheet that shows (much
            like looking at a map) what courier is used.
            >>
            States are listed down the side and accross the top of the excel sheet.
            (exp: Ohio and Maine = UPS)ok
            >well i would load the data into a database, but you can read straight
            >from
            >the excel file also.
            >>
            >you need to make a connection to the data
            >>
            >then use a SQL query to select the answere and reder it to the client.
            >>
            >do you know how to make a connection to a excel sheet?
            >>
            >do you know how to make a SQL query?
            >>
            >>
            >>
            On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
            >"Brave" <bravespl...@ya hoo.comwrote in
            >messagenews:11 62823689.348528 .67130@e3g2000c we.googlegroups .com...
            >>
            >I am hoping for a code example of how to do this, and hopefully it
            >will
            help me to see an easy way to code what seems to be a huge monster.
            >>
            I need to create a form that has two pulldown menues (field names
            Option1 and Option2). Each will house a list of the 50 U.S. States.
            Users would then be able to choose two states, and get a listing for
            a
            courier used for pickup\deliveri es (exp: My order is in Ohio, but I
            need it delivered to Maine. Who do I use?)
            >>
            I am not as familiar with code as I would like, but it seems I would
            need something like this:
            >>
            If option1 = this, and option2 = this, then the answer (field name
            Result) = thischoosing the states and then submitting the form would
            give you the 2
            >values. that is the easy part.
            >Now how do you expect to select the best courier from this
            >information?
            >>
            >You would need some sort of lookup table.
            >>
            I know that looks stupid, but I am hoping to show you how I am
            approching this in my head.
            >>
            Any ideas on how you would approch this project would be great. If
            you
            could offer a sample of code, I'm sure I could use it as a template
            for
            other projects. My idea is that this is just standard IF this THEN
            that
            coding, but I don't know the basics enough to create the code from
            scratch.
            >>
            Thanks for any time you can give.- Hide quoted text -- Show quoted
            text -- Hide quoted text -- Show quoted text -
            >

            Comment

            • Slim

              #7
              Re: A general &quot;How would you code this&quot; question.

              Better still

              I would upload my data into access, is there a reason for the data staying
              in excel format?

              "Mike Brind" <paxtonend@hotm ail.comwrote in message
              news:eS0E4fdAHH A.4328@TK2MSFTN GP03.phx.gbl...
              Hmmm. For connecting to Access, you are better off using the OLEDB driver
              rather than the ODBC driver in your example
              >
              Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
              Source=\somepat h\mydb.mdb;
              >
              Excel is pretty much the same:
              >
              Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
              Source=Fullpath \MyExcel.xls;Ex tended Properties=""Ex cel
              8.0;HDR=Yes;IME X=1"""
              >
              HDR=Yes indicates that the worksheet has a header row. Remove IMEX=1 if
              you want to write to the worksheet.
              >
              sql="SELECT field1, field2 FROM [Sheet1$]" is an example select statement.
              Notice that the worksheet name is followed by a $ sign.
              >
              --
              Mike Brind
              >
              >
              "Brave" <bravesplace@ya hoo.comwrote in message
              news:1162834585 .655392.19000@m 7g2000cwm.googl egroups.com...
              >>I have done some simple update queries, but nothing very advanced. I
              >have never connected to an excel sheet
              >>
              >Here is an example of a connection to an MS Access db I did. Would it
              >structure itself in a similar way?
              >>
              ><%
              >Set Conn = Server.CreateOb ject("ADODB.Con nection")
              >Conn.Open "driver={Micros oft Access Driver
              >(*.mdb)};;DBQ= \\*********Path to database******* .mdb;"
              >mySQL="INSER T INTO Table (FieldName) VALUES (Option1)"
              >Conn.Execute(m ySQL)
              >Conn.Close
              >Set Conn = Nothing
              >%>
              >>
              >>
              >On Nov 6, 11:39 am, "Slim" <m...@here.comw rote:
              >>"Brave" <bravespl...@ya hoo.comwrote in
              >>messagenews:1 162825517.49892 7.200970@e3g200 0cwe.googlegrou ps.com...
              >>>
              >Thanks for the reply. I will be given an excel sheet that shows (much
              >like looking at a map) what courier is used.
              >>>
              >States are listed down the side and accross the top of the excel
              >sheet.
              >(exp: Ohio and Maine = UPS)ok
              >>well i would load the data into a database, but you can read straight
              >>from
              >>the excel file also.
              >>>
              >>you need to make a connection to the data
              >>>
              >>then use a SQL query to select the answere and reder it to the client.
              >>>
              >>do you know how to make a connection to a excel sheet?
              >>>
              >>do you know how to make a SQL query?
              >>>
              >>>
              >>>
              >On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
              >>"Brave" <bravespl...@ya hoo.comwrote in
              >>messagenews:1 162823689.34852 8.67130@e3g2000 cwe.googlegroup s.com...
              >>>
              >>I am hoping for a code example of how to do this, and hopefully it
              >>will
              >help me to see an easy way to code what seems to be a huge monster.
              >>>
              >I need to create a form that has two pulldown menues (field names
              >Option1 and Option2). Each will house a list of the 50 U.S. States.
              >Users would then be able to choose two states, and get a listing
              >for a
              >courier used for pickup\deliveri es (exp: My order is in Ohio, but I
              >need it delivered to Maine. Who do I use?)
              >>>
              >I am not as familiar with code as I would like, but it seems I
              >would
              >need something like this:
              >>>
              >If option1 = this, and option2 = this, then the answer (field name
              >Result) = thischoosing the states and then submitting the form
              >would
              >give you the 2
              >>values. that is the easy part.
              >>Now how do you expect to select the best courier from this
              >>information ?
              >>>
              >>You would need some sort of lookup table.
              >>>
              >I know that looks stupid, but I am hoping to show you how I am
              >approching this in my head.
              >>>
              >Any ideas on how you would approch this project would be great. If
              >you
              >could offer a sample of code, I'm sure I could use it as a template
              >for
              >other projects. My idea is that this is just standard IF this THEN
              >that
              >coding, but I don't know the basics enough to create the code from
              >scratch.
              >>>
              >Thanks for any time you can give.- Hide quoted text -- Show quoted
              >text -- Hide quoted text -- Show quoted text -
              >>
              >
              >

              Comment

              • Brave

                #8
                Re: A general &quot;How would you code this&quot; question.

                No, my plan is to do it in access. I was just wondering about the
                specifics. I'm assuming that functionality may come in handy on a
                future project.

                Thanks for everything.

                On Nov 8, 12:12 pm, "Slim" <m...@here.comw rote:
                Better still
                >
                I would upload my data into access, is there a reason for the data staying
                in excel format?
                >
                "Mike Brind" <paxton...@hotm ail.comwrote in messagenews:eS0 E4fdAHHA.4328@T K2MSFTNGP03.phx .gbl...
                >
                >
                >
                Hmmm. For connecting to Access, you are better off using the OLEDB driver
                rather than the ODBC driver in your example
                >
                Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
                Source=\somepat h\mydb.mdb;
                >
                Excel is pretty much the same:
                >
                Conn.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data
                Source=Fullpath \MyExcel.xls;Ex tended Properties=""Ex cel
                8.0;HDR=Yes;IME X=1"""
                >
                HDR=Yes indicates that the worksheet has a header row. Remove IMEX=1 if
                you want to write to the worksheet.
                >
                sql="SELECT field1, field2 FROM [Sheet1$]" is an example select statement.
                Notice that the worksheet name is followed by a $ sign.
                >
                --
                Mike Brind
                >
                "Brave" <bravespl...@ya hoo.comwrote in message
                news:1162834585 .655392.19000@m 7g2000cwm.googl egroups.com...
                >I have done some simple update queries, but nothing very advanced. I
                have never connected to an excel sheet
                >
                Here is an example of a connection to an MS Access db I did. Would it
                structure itself in a similar way?
                >
                <%
                Set Conn = Server.CreateOb ject("ADODB.Con nection")
                Conn.Open "driver={Micros oft Access Driver
                (*.mdb)};;DBQ=\ \*********Path to database******* .mdb;"
                mySQL="INSERT INTO Table (FieldName) VALUES (Option1)"
                Conn.Execute(my SQL)
                Conn.Close
                Set Conn = Nothing
                %>
                >
                On Nov 6, 11:39 am, "Slim" <m...@here.comw rote:
                >"Brave" <bravespl...@ya hoo.comwrote in
                >messagenews:11 62825517.498927 .200970@e3g2000 cwe.googlegroup s.com...
                >
                Thanks for the reply. I will be given an excel sheet that shows (much
                like looking at a map) what courier is used.
                >
                States are listed down the side and accross the top of the excel
                sheet.
                (exp: Ohio and Maine = UPS)ok
                >well i would load the data into a database, but you can read straight
                >from
                >the excel file also.
                >
                >you need to make a connection to the data
                >
                >then use a SQL query to select the answere and reder it to the client.
                >
                >do you know how to make a connection to a excel sheet?
                >
                >do you know how to make a SQL query?
                >
                On Nov 6, 9:52 am, "Slim" <m...@here.comw rote:
                >"Brave" <bravespl...@ya hoo.comwrote in
                >messagenews:11 62823689.348528 .67130@e3g2000c we.googlegroups .com...
                >
                >I am hoping for a code example of how to do this, and hopefully it
                >will
                help me to see an easy way to code what seems to be a huge monster.
                >
                I need to create a form that has two pulldown menues (field names
                Option1 and Option2). Each will house a list of the 50 U.S. States.
                Users would then be able to choose two states, and get a listing
                for a
                courier used for pickup\deliveri es (exp: My order is in Ohio, but I
                need it delivered to Maine. Who do I use?)
                >
                I am not as familiar with code as I would like, but it seems I
                would
                need something like this:
                >
                If option1 = this, and option2 = this, then the answer (field name
                Result) = thischoosing the states and then submitting the form
                would
                give you the 2
                >values. that is the easy part.
                >Now how do you expect to select the best courier from this
                >information?
                >
                >You would need some sort of lookup table.
                >
                I know that looks stupid, but I am hoping to show you how I am
                approching this in my head.
                >
                Any ideas on how you would approch this project would be great. If
                you
                could offer a sample of code, I'm sure I could use it as a template
                for
                other projects. My idea is that this is just standard IF this THEN
                that
                coding, but I don't know the basics enough to create the code from
                scratch.
                >
                Thanks for any time you can give.- Hide quoted text -- Show quoted
                text -- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -

                Comment

                Working...