Results 1 to 4 of 4
  1. #1
    Fauzi is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    7

    Lightbulb Automate Numbering in form


    Hi guys, I still new to access and I want to know how to solve this .
    I have a table with 3500 records with following fields : Id_number, Num , Name , Address,. This table used for store customer data .
    My job is print 10 record randomly by customer arrival . I made this by use num field and put number manually, example I put 1 ,2 , 3 …. Till 10 , so for print i made criteria , I put 1 and 10 . Problem is because more and more customer is coming , I got confuse to put number manually . are there any way to get it automatic ? I am sure it is simple but don’t know how to do. Please Help.

  2. #2
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    use the rnd function (random) for eg. rnd([Id_number])

    so u would make a query;

    SELECT TOP 10 Rnd([ID]) AS random, Table_data.ID
    FROM Table_data
    ORDER BY Rnd([ID]);

    the above query is making random number for each ID. sorting in acending order, and showing top 10 results. now join this qry to the query/table you r using for the report and it will only show these ID's.

    everytime the query runs it will give you random set of 10 records. everytime the query runs it is not necessarily a unique set of records. if u have that requirement you will need to de-dup

  3. #3
    Fauzi is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    7
    when customer come , i have to assign a increment number ,when it reach 10 people , i need to print it in report , since there is 3500 people in db , it quite confusing . i need to assign number automatic . how to do it ?

  4. #4
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    u would use the dmax funtion. it tells u the highest number in a field. so it would be

    dmax("field name","table name")+1

    when putting in the field or table name u would write it in the quotation marks ("). look it up on the web for a better explaination. and u add 1 to that number to get your next number.

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

Similar Threads

  1. Replies: 5
    Last Post: 10-15-2012, 12:18 AM
  2. Sequential Numbering in a Form
    By Falafa in forum Forms
    Replies: 6
    Last Post: 10-05-2012, 08:20 AM
  3. how to get auto numbering on continuous form records
    By shubhamgandhi in forum Programming
    Replies: 1
    Last Post: 08-04-2011, 02:26 PM
  4. Numbering Entries In a Form
    By blueraincoat in forum Forms
    Replies: 7
    Last Post: 03-16-2011, 06:35 AM
  5. Automate sending SMS form MS Access
    By Johan in forum Programming
    Replies: 8
    Last Post: 04-15-2010, 12:51 AM

Tags for this Thread

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