How do I create a SELECT field

Posted on 2014-08-31
Last Modified: 2014-09-04
I want to create a form that gives users the ability to select the records they want to process. If I add a SELECT field to the table and two users do the same process at the same time they will mess one another up. Do I need to take the list of records, put them into a temporary table and add the SELECT field, or is there an easier/better/alternative way?
Question by:Rob4077
    LVL 48

    Accepted Solution

    This is nearly identical to this question where the alternatives are discussed:

    LVL 44

    Assisted Solution

    The simplest solution would be a selection/selected table.

    In the OnCurrent() event, you would do a check of the selection/selected table to see if it includes a row for the current user and current record (ID field).  Reflect the selected status on the form.  You can probably do this with one or two additional controls on the form.  A command button will allow the user to toggle the selected status and a label will show the selected status.  You might be able to use different button colors and texts with a single control change to your form.

    The simplest check would be a DLookup() function.
    LVL 30

    Assisted Solution

    Do I need to take the list of records, put them into a temporary table and add the SELECT field
    I support that and approach it this way:
    Assume table name a(aid Primary key, f1, f2)
    Code to create a_temp table.
    DoCmd.RunSQL "SELECT a.* INTO a_temp FROM a ;"
    Add column sel yesno
    DoCmd.RunSQL "ALTER TABLE a_temp ADD COLUMN sel yesno"
    Make the form record source  a INNER JOIN a_temp ON a.aid=a_temp.aid
    SELECT a.aid, a.f1, a.f2, a_temp.sel
    FROM a INNER JOIN a_temp ON a.aid = a_temp.aid
    ORDER BY a.f1, a.f2;
    Each user can run his own a_temp table and hence the selections made.

    Author Comment

    Thanks for the suggestions. I've been unable to return to this project for the last few days but will try the suggestions on Friday before I close out the question.

    Author Comment

    Thanks very much. Sorry for the delay. All the options provided seem to be easy enough to work with so I will share the points. Thanks.
    LVL 30

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now