A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

incrementing number based on criteria



 
 
Thread Tools Display Modes
  #1  
Old December 10th, 2005, 10:43 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default incrementing number based on criteria

I want my db to generate our reference # automatically based on input from
other fields. The number is the date record entered, the users initials, and
an incremental number. Ex. 120505GMM02

My form is based on a query and I have the query generating the first two
components from the date entered in reqdate and the initials entered. How can
I get an incremental number generated to go with the rest.

The number should start with 01 for each day and also for each user.
Therefore when GMM is entering his third record on the 5th it should generate
120505GMM03 even if there were 10 other records entered on the fifth by other
users. Each users numbers would start at 01 for each day.

Thanks.

Gary

  #2  
Old December 11th, 2005, 01:14 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default incrementing number based on criteria

use a DCount() function to count the number of records already in the table
for that user on that day, and add 1. see the DCount() Function topic in
Help to understand how it works, especially the criteria argument of the
function.

hth


"Gary" wrote in message
...
I want my db to generate our reference # automatically based on input from
other fields. The number is the date record entered, the users initials,

and
an incremental number. Ex. 120505GMM02

My form is based on a query and I have the query generating the first two
components from the date entered in reqdate and the initials entered. How

can
I get an incremental number generated to go with the rest.

The number should start with 01 for each day and also for each user.
Therefore when GMM is entering his third record on the 5th it should

generate
120505GMM03 even if there were 10 other records entered on the fifth by

other
users. Each users numbers would start at 01 for each day.

Thanks.

Gary



  #3  
Old December 11th, 2005, 06:16 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default incrementing number based on criteria

In addition to what Tina wrote, you should store your Ref# as 3 Fields, one
for the date of entry, one for the creator and one for the sequence number,
NOT as one Field.

--
HTH
Van T. Dinh
MVP (Access)



"Gary" wrote in message
...
I want my db to generate our reference # automatically based on input from
other fields. The number is the date record entered, the users initials,
and
an incremental number. Ex. 120505GMM02

My form is based on a query and I have the query generating the first two
components from the date entered in reqdate and the initials entered. How
can
I get an incremental number generated to go with the rest.

The number should start with 01 for each day and also for each user.
Therefore when GMM is entering his third record on the 5th it should
generate
120505GMM03 even if there were 10 other records entered on the fifth by
other
users. Each users numbers would start at 01 for each day.

Thanks.

Gary



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sum number of cells based on letter/title criteria chazmac Worksheet Functions 2 November 28th, 2005 05:09 PM
Concatenate fields based on criteria Angel Running & Setting Up Queries 2 November 10th, 2005 10:59 PM
Returning Results Based on Two Criteria [email protected] Worksheet Functions 7 October 23rd, 2005 02:53 PM
Can a query be written to search on a variable number of criteria. bpoley Running & Setting Up Queries 0 March 12th, 2005 12:41 AM
Office 2003 installation problem, log file attached.... Ryan Setup, Installing & Configuration 0 January 20th, 2005 06:57 PM


All times are GMT +1. The time now is 04:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.