Generating SQL on the Fly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rewalk
    New Member
    • Jun 2007
    • 17

    Generating SQL on the Fly

    Hello all,

    First, I'd like to thank everyone that helped me with my last problem. It was greatly appreciated. What I'm trying to do is generate SQL on the fly so that a report can be generated and exported to Excel based on selections made by the user. For example, they'll select a date range, a location and what they want to sort the data by. Can anyone point me in the right direction as to how to do this? Thank you in advance for all your help!
  • Stang02GT
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Originally posted by rewalk
    Hello all,

    First, I'd like to thank everyone that helped me with my last problem. It was greatly appreciated. What I'm trying to do is generate SQL on the fly so that a report can be generated and exported to Excel based on selections made by the user. For example, they'll select a date range, a location and what they want to sort the data by. Can anyone point me in the right direction as to how to do this? Thank you in advance for all your help!




    If i am understanding this right... i feel the best way to do this would be by using combo boxes.

    You could have one combo box based off of another.

    For example you can have the user select a date in one box

    In the next box they will be able to select a location

    Finally they will be able to select how they would like to sort the data


    The selections in each box will be based off of the users selection in the previous box...


    If this is where you want to go with this, let me know and we can get you some code to do this!

    Comment

    • rewalk
      New Member
      • Jun 2007
      • 17

      #3
      Yes! That sounds like exactly what I'm looking for. Would it then be possible to have this set of precedures generate some SQL code that would have its results opened in Excel?

      Comment

      • Stang02GT
        Recognized Expert Top Contributor
        • Jun 2007
        • 1206

        #4
        Originally posted by rewalk
        Yes! That sounds like exactly what I'm looking for. Would it then be possible to have this set of precedures generate some SQL code that would have its results opened in Excel?


        Im sure through some Visual Basic code you could have the results exported to Excel.....i'll start putting some code together for the 1st part of this!

        Comment

        • rewalk
          New Member
          • Jun 2007
          • 17

          #5
          Thank you so much. I'm very grateful for your help!

          Comment

          • Stang02GT
            Recognized Expert Top Contributor
            • Jun 2007
            • 1206

            #6
            Not a problem at all...just glad i can help! :)

            Comment

            • Stang02GT
              Recognized Expert Top Contributor
              • Jun 2007
              • 1206

              #7
              Alright.... here is a web site that gives you sample code and explains how you filter one combo box based on another.

              Hope this helps...this artilce will explain it better then i can.

              http://www.mvps.org/access/forms/frm0028.htm

              Comment

              • rewalk
                New Member
                • Jun 2007
                • 17

                #8
                Excellent. That did the trick and I got everything to work. Thank you very much!

                Comment

                • Stang02GT
                  Recognized Expert Top Contributor
                  • Jun 2007
                  • 1206

                  #9
                  No problem glad i could help!

                  Comment

                  Working...