wordpress statistics
  • Today is Friday, May 18, 2012

10 Responses to “Auto Numbering In Query Column”

  1. Anonymous says:

    Hello Ramachandran,

    I'm another developer who can use this query info. Thank you for putting this together!

    I copied and pasted your code and got as far as point #5. and tried it. I got an error message at "5. Open the Query in normal view." A parameter box appeared for OrderID, and no matter what value I entered, I got an error message 2471: The expression you entered as a query parameter produced this error: '[OrderID]'

    Can you help me with this and what was wrong? I copied and pasted your code. THANK YOU! Really want to get this to work.

    Paula

  2. I have copied the Code and SQL String from the Web Page and tried out again. I could not find any problem with it. Are you sure that you have given the Query Name correctly as third Parameter of the Function?

    Anyway, you can download a sample database with the Code and the Queries from the following Link:

    http://www.msaccesstips.com/downloads/2010/01/QryAutoNum.zip

    Regards,

  3. Anonymous says:

    a.p.r. pillai, thanks for the Link. It worked nicely!
    Paula

  4. eki einstein says:

    thanks its works fine!!!! but i have some problems when i used some criteria based on text field in a form (my query filter based on that) its wont work the value of “SRL” number turning into zero values do you have any sugest ?

    i need the auto number because its the only way i know to have pagination report(in report view) on ms acces or do you have another suggest to make it?

    “im from indonesia sorry if i had bad english”

  5. a.p.r.pillai says:

    It will not work with Queries that references Form controls or Parameter Queries as criteria.

    Create an output Table by filtering the data by using above methods and create a separate query with the output table and call the function QrySeq() in a column in this final Query.

    There is another method for giving Group-wise Sequence numbers. This has to be done on the output table rather than on a Query. The link is given below:

    http://msaccesstips.com/2011/05/product-group-sequence-with-auto-numbers/

  6. rosegmeyer says:

    I have been needing this utility for quite some time but with an additional level of grouping. I have to begin re-numbering within a table everytime the PROPNUM changes. Basically the data needs to look like below. Notice the months are being counted sequentially. Can anyone help with providing code for this? MANY THANKS IN ADVANCE!

    PROPNUM MONTH VALUE COUNT
    45678 01-2010 600.00 1
    45678 02-2010 700.00 2
    45678 05-2010 500.00 3

    1234 01-2010 200.00 1
    1234 03-2010 450.00 2
    1234 07-2010 200.00 3

  7. a.p.r.pillai says:

    Take a look at the following link that does exactly what you require:

    Product Group Sequence with AutoNumbers

  8. Lindajo13 says:

    I have tried to use this function in my own database but I’m getting an error 13: Type Mismatch on QrySeqQ. The field I’m using as the parameter is a text field. Would this cause a problem?

  9. a.p.r.pillai says:

    You may use any field (numeric or text) or join several fields and use it as parameter to the function. There is only one condition the parameter value must be unique.

    QrySeq([ORDERID],”[ORDERID]“,”QUERY4″)

    The first parameter [ORDERID] is the data field reference having unique value (numeric or text) in it. If you don’t have a single field with unique values then join one or more fields and create a separate column like: myKey: [EmployeeID] & [FirstName] & [LastName] then give the column name [myKey] as first parameter. Note, here EmployeeID is numeric field and FirstName and LastName are text. When all the three are joined the final result is text.

    Second Parameter is the name of the first parameter column enclosed in Quotes: “myKey”. If you left a space between the words my Key then enclose them in square brackets “[my Key]“, otherwise the [] are not needed.

    Third Parameter is the Query Name, from which you are calling the function, in quotes: “Query4″.

Leave a Reply

You must be logged in to post a comment.