Pull a random number more often

Discussion in 'Microsoft Access VBA Modules' started by miketrack, Jul 6, 2012.

  1. miketrack

    miketrack

    Joined:
    Jun 25, 2012
    Messages:
    2
    Likes Received:
    0
    I have made a database in access to randomly pick numbers. The only only problem is that I want to weight certain types of part numbers by a field called P/N class. My query spits out the example below. Every time I run it I get different results which is what I want.

    Example: Product Number.....P/N Class
    102BD5-CS2-ZN1....................a
    5410CV-PL2-AL1....................c
    11738-LW-SS2.......................c
    125200002BD3-SS1-EP..........a
    222070BD2-1-CS1-ZN1...........a



    The part numbers I store in my table have either a class of A, B, C or D. I would like to weight A as 90-95% picked, B as 80-85%, C as 25-30 and D as 20-25.

    The goal for my database is to NOT change my data in the table and use some kind of code to pull certain types of product numbers. I have experimented in VBA in modules, SQL in queries and macros but I still have not solve my issue of weighting.

    If anyone knows a better overall database solution than using Access I will listen. The main purpose for my project is to pull five random part numbers having more A's and B's than C's and D's in each group of five. I would love it if I could hit print once and three groups of five results are on one page with the signatures and dates included(see attachment) and I print ten total pages most part numbers being different. I would be cutting each group of five on the dotted line and handing them to someone to check and mark inventory counts.

    Let me know if you can help me out.

    Michael
     

    Attached Files:

    miketrack, Jul 6, 2012
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aristotele64

    Random with Number And Probability [very long]

    Aristotele64, Apr 18, 2004, in forum: Microsoft Access VBA Modules
    Replies:
    1
    Views:
    151
    Tim Ferguson
    Apr 19, 2004
  2. Guest

    True Random Number Generation

    Guest, Jul 20, 2004, in forum: Microsoft Access VBA Modules
    Replies:
    1
    Views:
    141
    Rick B
    Jul 20, 2004
  3. Guest

    Random Number Generation

    Guest, Nov 19, 2004, in forum: Microsoft Access VBA Modules
    Replies:
    0
    Views:
    133
    Guest
    Nov 19, 2004
  4. Guest

    How can I pull a random percentage of records from a table?

    Guest, Oct 25, 2005, in forum: Microsoft Access VBA Modules
    Replies:
    1
    Views:
    623
    Allen Browne
    Oct 25, 2005
  5. Guest

    HELP - Random numbering & Random ASCII

    Guest, May 18, 2006, in forum: Microsoft Access VBA Modules
    Replies:
    24
    Views:
    428
    Dirk Goldgar
    May 19, 2006
Loading...

Share This Page