Multiple Queries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bluish
    New Member
    • Nov 2006
    • 4

    Multiple Queries

    Hi

    Completly New to Access.
    Is it possible to create 300 0r 400 seperate Queries from the design view.

    The Data Base is ready the fields are there and I can create ONE query at a time.

    Can I create them all at the one time using Critera and if so how!!

    The fields require for each query are the same (with one exception each time)
    SF001 or SF002 or SF003 etc.

    A seperate query for each SF

    Queries needed from SF001 to SF498

    Regards
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32666

    #2
    There are ways of doing what you want, but I suspect that if you post what you're actually trying to do, that there are better concepts that will enable you to avoid having so many.
    Just doctoring the one on the fly is what springs to mind.
    It would depend on how you intend to use it though.
    Let us know.

    Comment

    • bluish
      New Member
      • Nov 2006
      • 4

      #3
      Hi

      Currently I have about 15 thousand divx files on the computer.

      I have a batabase that lists All of these files.
      Disc No / Track No / Artist / Song / Male / Female /Etc.
      To be sure that the database records are exactly the as the Divx files, I need to
      check them individually (or in disc order) the discs hold from 10 to 30 tracks.
      SF001 has 23 tracks.

      I'v been creating the queries for each SF (PHEW) Fingers Wasted.

      The datebase will be printed.

      My intention is that I can see at a glance SF (whatever) and sellect that number
      in from the hard disc (Knowing the it will play the correct disc)

      Many Thanks

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32666

        #4
        OK, I guess you've got at least one query set up for SF001.
        Could you post the SQL of that query and we can look at some VBA code to doctor it for more flexibility.

        Comment

        • bluish
          New Member
          • Nov 2006
          • 4

          #5
          Originally posted by NeoPa
          OK, I guess you've got at least one query set up for SF001.
          Could you post the SQL of that query and we can look at some VBA code to doctor it for more flexibility.
          It would be great if I knew how to send that SQL to you (Simply dont know how)

          Here is the layout that I have:

          Fields: / Disc Name / Track / Song / Artist /
          Table: / Karaoke / Karaoke / Karaoke / Karaoke /
          Sort: / / ascending / / /
          Show (All Ticked)
          Critera / "SF001" / / / /

          Have I given enough info !!

          Many Thanks

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32666

            #6
            To get the SQL from a query :-
            Open the query in design mode.
            From the View menu select SQL view.
            Copy and Paste the contents of the window into a post here.
            Don't forget to surround the SQL with Code & /Code tags.

            Comment

            • bluish
              New Member
              • Nov 2006
              • 4

              #7
              [QUOTE=NeoPa]To get the SQL from a query :-

              SELECT [Karaoke Por].[Disc Name], [Karaoke Por].Track, [Karaoke Por].Song, [Karaoke Por].Artist
              FROM [Karaoke Por]
              WHERE ((([Karaoke Por].[Disc Name])="SF001"))
              ORDER BY [Karaoke Por].Track;

              Thank You

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32666

                #8
                It depends on what you're wanting to do with the queries once you have them.
                If you're doing it in code then you can extract the SQL from your first query and modify the SQL string, changing SF001 to SF??? depending on what's required.
                You get the SQL from your main query using :
                Code:
                strSQL = CurrentDb.QueryDefs("YourQuery").SQL
                If you want to use SF241 then your code to modify the SQL would be :
                Code:
                strSQL = Replace(strSQL, "SF001", "SF241")
                Originally posted by Help
                Replace Function

                Description

                Returns a string in which a specified substring has been replaced with another substring a specified number of times.

                Syntax

                Replace(express ion, find, replace[, start[, count[, compare]]])

                The Replace function syntax has these named arguments:

                Part Description
                expression Required. String expression containing substring to replace.
                find Required. Substring being searched for.
                replace Required. Replacement substring.
                start Optional. Position within expression where substring search is to begin. If omitted, 1 is assumed.
                count Optional. Number of substring substitutions to perform. If omitted, the default value is –1, which means make all possible substitutions.
                compare Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values.
                PS. With a clearer understanding of how you intend to use the queries we could perhaps be of more assistance. Queries are used in all sorts of ways and some things are appropriate when building a recordsource for a form which wouldn't be for just showing the data in a table view.

                Comment

                Working...