﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Microsoft Access / Microsoft Access  / Incremental Number / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 17:50:45 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>thank you everyone</description><pubDate>Sat, 01 Dec 2012 16:01:08 GMT</pubDate><dc:creator>sasansamani</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>HiMy apologies for not being able to contribute to this earlier - I'm fairly certainthat I am in a different time zone to you.If you are wanting to do this in an Access query, then you could use a LEFT OUTER join.  Join the table with the incrementing number to the table you wish to check via the two number attributes, then set the join type to the left outer join option (2).  If you create a test query in this way (Important Note: drag your join from the table with the incrementing number to the table you wish to check) and simply add the two attribute, you will see matching numbers where you have used the number and the incrementing number and a null in the cases where the numbers haven't been used.Taking this a step further, add a null criteria for the attribute in the table you are checking, and you will be returned a set of numbers that haven't been used.  You could then use this as a subquery for generating the next unused number by changing the query to a group (aggreagte) query and use the min option.CheersRowan</description><pubDate>Sat, 01 Dec 2012 03:30:04 GMT</pubDate><dc:creator>ProofOfLife</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>You're welcome. Glad that worked for you.</description><pubDate>Fri, 30 Nov 2012 15:30:08 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>thank you very much. It works now.I tried to use something simlar to that.</description><pubDate>Fri, 30 Nov 2012 15:20:52 GMT</pubDate><dc:creator>sasansamani</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>[quote][b]sasansamani (11/30/2012)[/b][hr]SELECT DMax("[AssetNumber]","Waste Hauler Number","+1") AS Expr1 FROM [Waste Hauler Number];I am getting two 4001. What I am doing incorrectly?[/quote]The last parameter is the criteria (it acts like a where clause). "+1" is not valid there.Personally I hate those built in functions. I find them obtuse and difficult to read. I would write that as a query instead.[code]select MAX(AssetNumber) + 1 from [Waste Hauler Number][/code]</description><pubDate>Fri, 30 Nov 2012 15:12:48 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>SELECT DMax("[AssetNumber]","Waste Hauler Number","+1") AS Expr1 FROM [Waste Hauler Number];I am getting two 4001. What I am doing incorrectly? I have 4000 and 4001</description><pubDate>Fri, 30 Nov 2012 14:52:53 GMT</pubDate><dc:creator>sasansamani</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>[quote][b]sasansamani (11/30/2012)[/b][hr]I made myself confused and you. I need more coffee. I thought you were referrring to another field.Right now my problem is how do I validate against another table? How do I tell the form field to show me numbers I havent used before?[/quote]MAX(Field) + 1 ???</description><pubDate>Fri, 30 Nov 2012 13:57:44 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>I made myself confused and you. I need more coffee. I thought you were referrring to another field.Right now my problem is how do I validate against another table? How do I tell the form field to show me numbers I havent used before?</description><pubDate>Fri, 30 Nov 2012 13:43:16 GMT</pubDate><dc:creator>sasansamani</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>[quote][b]sasansamani (11/30/2012)[/b][hr]Actually my autonumber starts at 1000. You are right. How do I automatically assign random numbers for a 4 or 5 digit number? How do I determine if I have used that number before in the table?00000-V/C [b]0000[/b]- AT-YR[/quote]If it is an autonumber you don't. That is the point of it being automatic...you don't have to do anything.</description><pubDate>Fri, 30 Nov 2012 13:32:49 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>Basically what I am doing is I am parsing 0000-V/C 0000-AT-YR and then putting each section into its field in a table. I need to know how I can determine if that asset number have been used before? If that number has nerver been used then it needs populate into the form field called Asset.In other words, How do I validate against another table? Do I use DCount Function?</description><pubDate>Fri, 30 Nov 2012 13:22:28 GMT</pubDate><dc:creator>sasansamani</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>Actually my autonumber starts at 1000. You are right. How do I automatically assign random numbers for a 4 or 5 digit number? How do I determine if I have used that number before in the table?00000-V/C [b]0000[/b]- AT-YR</description><pubDate>Fri, 30 Nov 2012 13:13:17 GMT</pubDate><dc:creator>sasansamani</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>If you are using an autonumber you are going to have gaps. This is perfectly normal. Honestly, why does it matter if there are gaps?</description><pubDate>Fri, 30 Nov 2012 12:50:10 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>[quote]how would you identify if I have used that number?How would you tell the field in the form to populate the numbers you haven't used?[/quote]I would like to this in a query.</description><pubDate>Fri, 30 Nov 2012 12:42:46 GMT</pubDate><dc:creator>sasansamani</dc:creator></item><item><title>RE: Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>HiI'm sorry to answer your questions with a question but we need to know what method you are using to increment from 0000 to 9999.If you are using an auto increment data type (that is incrementing by 1) then the answer is simple - use a max (query) or dmax (VBA) function.  If you are using code to do it and the numbers aren't sequential then it gets more complex.The answer will also depend on whether you are attempting to do this in a query or VBA.CheersRowan</description><pubDate>Thu, 29 Nov 2012 16:47:41 GMT</pubDate><dc:creator>ProofOfLife</dc:creator></item><item><title>Incremental Number</title><link>http://www.sqlservercentral.com/Forums/Topic1390273-131-1.aspx</link><description>lets say I want to increment 0000 to 9999. I know how do this.how would you identify if I have used that number?How would you tell the field in the form to populate the numbers you haven't used?I guess my second question and third question are related.</description><pubDate>Wed, 28 Nov 2012 22:03:59 GMT</pubDate><dc:creator>sasansamani</dc:creator></item></channel></rss>