How to distribute data from the same table

  • Thread starter Thread starter subbu
  • Start date Start date
S

subbu

Hi,
I have the requirement to distribute data to 3 members
from the same table randomly.how to go about

subbu
 
Hi,
The users will key in how many records they want to
view.Once the record is selected for view it is not
selected again by any other user or by the same user.All
the users will access the same table

Hope i have cleared the requirement

subbu
 
Thanks for the suggestion.It looks great.But updating the
field is a problem as we have to get the id for each row
field.

In this case there is no primary key for the table.can we
have autonumber field while using the make-table query

subbu


Other idea i have is to use Make-table query,add the
column with default value and update after viewing.
-----Original Message-----
Sigh. Not really.

Based on what you have said, I'm guessing that you want your users to be
able to select a random number of records for "viewing," then flag those
selected records as viewed and make them unavailable to other users.
Without knowing anything about your table structure, it's impossible to
get very specific. But one option might be to add a "Viewed" Yes/No
field in your base table, then create a user interface form to query the
table using the RND() function (assuming you're using A2K or later,
which you didn't specify). I'm visualizing something like (warning, air
code):

SELECT Top Forms![YourForm]![RecordNum] YourField
FROM YourTable
WHERE YourTable.Viewed="No"
ORDER BY (Rnd([YourTable].[YourField]));

....with an Update Query in one of the form's Events (OnClose, maybe?)
that updates the Viewed field in the records selected to "Yes" after the
user has looked at them.

You can read more about the RND() function in the MS KB
(http://support.microsoft.com/?id=208855).

hth,

LeAnne
Hi,
The users will key in how many records they want to
view.Once the record is selected for view it is not
selected again by any other user or by the same user.All
the users will access the same table

Hope i have cleared the requirement

subbu
.
 
subbu said:
Thanks for the suggestion.It looks great.But updating the
field is a problem as we have to get the id for each row
field.

And this is a problem because...?
In this case there is no primary key for the table.

Why not? A primary key is a fundamental part of any table in a RDBMS.
Just as a license plate number identifies a car, the primary key
uniquely identifies each record in a table.
can we
have autonumber field while using the make-table query

subbu

Other idea i have is to use Make-table query,add the
column with default value and update after viewing.

_What_ Make-table query? Are you saying that you create a new table
every time a user views a group of records? Is this really necessary?
Re-read my suggestion upthread. A _query_ can return the number of
randomly selected records requested by the user and display them in a
recordset view that looks just like a table datasheet; and the Update
query can flag the "viewed" records so they don't come up again in the
next search. The only reason I can see for having a Make-table is if you
want to preserve the results of each search. But there has to be a
better way than cluttering up your db with lots of search results
tables. It would help if you posted a clear description of your database
structure, which version of Access you're using, and what you're trying
to accomplish. And yes, an Autonumber primary key would work fine, as
long as you don't expect it to be sequential.

LeAnne
 
Back
Top