PC Review


Reply
Thread Tools Rate Thread

Creating a tracking number

 
 
=?Utf-8?B?ZHNob3J0?=
Guest
Posts: n/a
 
      7th Jun 2005
I have 5 consultants in my table called tblConsultant. I want to generate
Task Order numbers for each consultant as a project is awarded to a
particular consultant. I have assigned a two digit consultant code to each
consultant and would like the task order number generated to be an
incremental number that combines the following :
A prefix of "NE", the two digit consultant code, the four digit year (2005)
and then the incremental number (starting at 100). As a new task order is
generated for this consultant (it could be on this project or on a new
project), I would like the project number to increment by one. I think I
need to store this number as a field in my table, rather than just
concatenating other fields on my form. My two questions are: (1) How do I
keep track of the counter for each consultant, and (2) How do I program
Access to automatically generate the task order number each time a new task
order is created?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2xhdHV1?=
Guest
Posts: n/a
 
      7th Jun 2005
You need a field in your table to carry the Task Order Number. If this is a
single user system, it is very simple. If it is a multi user system, then
you need to program for the possibility that another user could be adding a
project for the same consultant and one of you could overwrite the other's
entry.

Since you need the consultant's code, this should probably be in the After
Update event of the control where you select the consultant:

strTaskOrder = "NE" & Me!txtConsultant & Cstr(Year(Date())
strNext = (IsNull(DMAX("[TaskOrderNo]","MyTableName", _
&"left([TaskOrderNo],8) = '" & strTaskOder & "'")

If IsNull(strNext) Then ' No Number Found
strTaskOrder = strTaskOrder & "100"
Else
intNextNo = Cint(Right(strNext,3)) + 1
Me.TaskOrder = strTaskOrder & Cstr(intNextNo)
End If

At this point you will have the next Task Order Number. Now, to ensure you
don't have the multi user problem, in the Before Update event of the form:

If Not (IsNull(DLookup("[TaskOrderNo]","MyTableName", _
&"[TaskOrderNo] = '" & Me.TaskOrder & "'") Then
'Do whatever you need to do here to let the user know and assign the next
number
End If

"dshort" wrote:

> I have 5 consultants in my table called tblConsultant. I want to generate
> Task Order numbers for each consultant as a project is awarded to a
> particular consultant. I have assigned a two digit consultant code to each
> consultant and would like the task order number generated to be an
> incremental number that combines the following :
> A prefix of "NE", the two digit consultant code, the four digit year (2005)
> and then the incremental number (starting at 100). As a new task order is
> generated for this consultant (it could be on this project or on a new
> project), I would like the project number to increment by one. I think I
> need to store this number as a field in my table, rather than just
> concatenating other fields on my form. My two questions are: (1) How do I
> keep track of the counter for each consultant, and (2) How do I program
> Access to automatically generate the task order number each time a new task
> order is created?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
? creating and tracking appointment =?Utf-8?B?Q2Fsdmlu?= Microsoft Access Database Table Design 2 9th Oct 2007 04:29 PM
Need help in creating MS Access database for MLM Tracking Brent Taylor via AccessMonster.com Microsoft Access Forms 1 18th May 2005 11:18 AM
Need Help creating MLM tracking in MS Access Brent Taylor via AccessMonster.com Microsoft Access 1 26th Apr 2005 11:35 PM
Creating a Tracking Form Paula Down Microsoft Access Forms 1 13th Sep 2004 07:19 PM
Creating Tracking system =?Utf-8?B?MXRpbWU=?= Microsoft Access 2 27th May 2004 08:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:46 PM.