Results 1 to 2 of 2
  1. #1
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67

    Help with Update Query

    I need to write an update query which takes records from a table and updates a particular field.



    The only caveat to this is that I need a text box to allow the user to enter the number of random records they want to update. For example the form will show two text boxes and one button. One text box would show the number of records available to be assigned. The second text box would allow the user to enter the number of records they would like to have assigned to them(Ie. 10). The button would then run an update and fill in the "Assigned" field for the number of records entered (ie. 10)

    Does anyone have any suggestions on how to execute?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Consider: INSERT INTO tablename(fieldname) SELECT fieldname ....;

    Options:

    1. Build query that selects x number random records and that query is subquery to INSERT action.

    2. Build query that selects 1 random record and that query is subquery to INSERT action. In VBA loop structure execute query as many times as specified by user.

    Google: SQL select random record
    http://www.cosnetics.co.uk/articles/...s-from-access/
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  2. Replies: 4
    Last Post: 11-10-2011, 03:41 PM
  3. Replies: 2
    Last Post: 09-21-2011, 01:30 PM
  4. Replies: 1
    Last Post: 08-19-2011, 12:16 PM
  5. Update 2 tables with one Update Query
    By Douglasrac in forum Queries
    Replies: 4
    Last Post: 04-14-2011, 08:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums