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
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