Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / June 2005

Tip: Looking for answers? Try searching our database.

"random" vs. "representative"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RD - 17 Mar 2005 19:56 GMT
I'm often asked to create reports containing a "random" selection of
records.  I've got several different functions for doing this
depending on the report requirements.

What I'm finding out is that when people say they want a "random"
sample they really mean "I want a representative sample but I don't
want to choose the records myself".

I have a "type" field  and a "subtype" field.  There would be types
01-99 and subtypes 0-9 and A-Z combined appearing like: 30-C or 04-1
etc.

The request was for "a random sample of 100 records but make sure
there are plenty of 45-* records".

Anybody have any ideas on returning "representative" records?

Thanks for any help,
RD
RD - 18 Mar 2005 17:12 GMT
Fuhgeddaboudit.  They've changed their minds.

I think, out of curiosity, I might take some time to develop a method
for pulling "representative" records.  It might be useful for
statistical analysis.

>I'm often asked to create reports containing a "random" selection of
>records.  I've got several different functions for doing this
[quoted text clipped - 15 lines]
>Thanks for any help,
>RD
Dizzyone - 01 Jun 2005 00:01 GMT
I saw in your question where you stated that you have several different
functions for selecting random records in a report. I have a table  that has
an autonumber field.  I  need to retrieve every NTH record and I can't figure
out how to do this. I have created some macros and modules so I'm not a
complete Access/VBA novice. Any help you can give me will be greatly
appreciated.  

> I'm often asked to create reports containing a "random" selection of
> records.  I've got several different functions for doing this
[quoted text clipped - 15 lines]
> Thanks for any help,
> RD
PC Datasheet - 01 Jun 2005 00:23 GMT
Create a query based on your table. Add a calculated field that numbers your
records appropriately depending on what Nth is. Then pull out the records
where the number is evenly divided by N.

--
                                       PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
                             resource@pcdatasheet.com
                                www.pcdatasheet.com

> I saw in your question where you stated that you have several different
> functions for selecting random records in a report. I have a table  that has
[quoted text clipped - 22 lines]
> > Thanks for any help,
> > RD
dunk - 02 Jun 2005 16:38 GMT
Use Step to pull every Nth record.

From VB Help:

Using the Step keyword, you can increase or decrease the counter variable by
the value you specify. In the following example, the counter variable j is
incremented by 2 each time the loop repeats. When the loop is finished, total
is the sum of 2, 4, 6, 8, and 10.

Sub TwosTotal()
   For j = 2 To 10 Step 2
       total = total + j
   Next j
   MsgBox "The total is " & total
End Sub

HTH,
RD

> I saw in your question where you stated that you have several different
> functions for selecting random records in a report. I have a table  that has
[quoted text clipped - 22 lines]
> > Thanks for any help,
> > RD
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.