RE: Random ID selection
From: Peter Martin (PeterMartin_at_discussions.microsoft.com)
Date: 09/03/04
- Next message: Kelli McCann: "MERGING TWO QUERIES"
- Previous message: Kevin McBrearty: "Re: Filter Report by Form"
- In reply to: Rich: "Random ID selection"
- Next in thread: Tom Ellison: "Re: Random ID selection"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 3 Sep 2004 07:55:02 -0700
Do you only want to see each customer once? If so and you're only going to
sample say <5% of customers, would it be ok to see the occasional customer a
second time?
If you don't care if you see them again then, assuming CUSTINFO.ID is a
number and sequential, you could use something like this under your button.
dim rst as dao.recordset
set rst = me.recordsetclone
with rst
.findfirst "CUSTINFO.ID=" & int(rnd()*dmax("id","Custinfo")+1)
if not .nomatch then
msgbox "Try again!"
else
me.bookmark = .bookmark
endif
end with
set rst = nothing.
Read the help on rnd() to understand it's limitations.
Best Regards,
Peter.
"Rich" wrote:
> Hello,
> I need some help getting a random set of data ..here is the situation
>
> My CUSTINFO table has ID field (primary key) and then other customer
> information in 9000 rows of data. I need to figure out a way where I can have
> a record selected randomly based on the ID.
>
> Then perhaps every time i click a button a new random choice from the table
> appears
>
> Thanks in advance!
> -Rich
- Next message: Kelli McCann: "MERGING TWO QUERIES"
- Previous message: Kevin McBrearty: "Re: Filter Report by Form"
- In reply to: Rich: "Random ID selection"
- Next in thread: Tom Ellison: "Re: Random ID selection"
- Messages sorted by: [ date ] [ thread ]