Assign Incrementing Number Based On Common Field

Apr 16, 2013

My access database is used to process vehicle trips. Each shift, a vehicle is assigned a docket number (paper based), and on this docket the driver fills out each trip he/she makes. In a shift (thus on a docket) there may be 5 - 15 trips. I want to create an incrementing number for each trip in a new field - can be created as they are processed or after the fact by looping through the resultant data - whatever is easier.

So in simple terms, return all trips for each docket number then number each trip.

View Replies


ADVERTISEMENT

Incrementing Number Based On 2 Other Fields

Dec 9, 2005

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.

I asked this earlier but thought I would restate my question in hopes of getting my thoughts around this. I appreciate your patience with me.

Thanks.

Gary

View 3 Replies View Related

Queries :: Auto Assign Increasing Number Based On Multiple Factors

Jun 11, 2015

I have written a check writer program for the company I work at. I have a table for Venders, and a separate table Invoices set with a 1-many relationship. When checks are printed it consolidates all the unpaid invoices for each vender to print a single check and mark it as paid with the date.

The checks already have a check number printed on them so what I need is an option that will allow me to enter the first check number when the print starts and Access will put that number in a field on the invoices page for each invoice associated with the first vender printed, then would increase the number by one and put that number in the invoices associated with the next vender printed.

View 5 Replies View Related

Forms :: Assign Next Number To A Field Not Using Autonumber

Apr 24, 2014

Auto number will not work for what I want to do. I am creating a simple database that will assign the user with the next incremental number in a field. The intent of the database is for the user to enter three text fields and then obtain the number. I believe that Dmax would work but do not know how to make populate the table.

View 10 Replies View Related

How To Randomly Assign A Person Based On Entered Field In Form

Feb 10, 2015

I need to assign those appraisers to an order based on what county they cover. My main table (orders) is simple. Just an order number, order date, county and appraiser.I have a form with entry fields for all these except appraiser. I envision a "assign" button that will then pick the next appraiser in the county that was chosen. It's just a "round robin" type of thing, so the first order placed for Monroe would be assigned to ABC. The next order would be for Cecil and would assign 123. Next order for Monroe would assign DEF. I know there are many way this can be done but I've been looking at this for hours and I'm drawing a blank on the easiest way to do it.

View 5 Replies View Related

Incrementing Number

Jan 16, 2006

Hi all

I am adding two records to an empty table using an append query (or make table query). I would like the first record to have 1 in the ID field and the second to have 2. I will then delete 2, append 1 elsewhere and empty the table and start over again.

Any suggestions? It needs to be 1 and 2 each time not just an autonumber.

Thanks

Greg

View 1 Replies View Related

Incrementing Number Fields

May 5, 2005

Hey, long time reader, first time poster.

I have a database created that is used to catalog different projects. When the user adds a new record and that project is already in the database it gives the user a message stating that that project already exists. It gives the option of cancelling and goes back so the user can name it something different. Or the user can continue and it creates a duplicate copy.

Instead of creating a duplicate copy, I want it to increment a number field named [Duplicates] by 1.

Example:
If project 'A' is already in the database and the user adds it again it increments the duplicate field by one. So now the properties of project 'A' shows that there is 1 duplicate. Does that make sense?

Here's my duplicate code so far:

Private Sub Form_BeforeUpdate(Cancel As Integer)

Dim Response As Integer

If Not IsNull((DLookup("Project_Name", "Development_Projects", "[Project Name]= '" & Me.Project_Name & "'"))) Then
Response = MsgBox("That Project already exists" & vbCr & vbCr & "Select Yes to duplicate record, No to cancel.", vbCritical + _
vbYesNo + vbDefaultButton2, "Duplicate Data")

If Response = vbYes Then
[Duplicate] = [Duplicate + 1]
Exit Sub
Else
Cancel = True
End If
End If


End Sub

View 2 Replies View Related

Incrementing Number For Old Records

Nov 8, 2006

I have 4 tables on my dbase. On the last table underlies all records pertaining to customer payments.

tblCollectionData

ColID - PK
PolID - FK
Amount
ORDate
ORNumber

I want to add another field which i would name -- CollectionNumber. In this field, i need an incrementing number for each PolID.

For each PolID (no duplicates), there could be 1 to 6 records of payment. I need the number to start at 1 for each unique PolID.

Please help me on this. I've been looking at different posts but i still can't find answer. :-(


Thanks!
Sheila

View 8 Replies View Related

Incrementing A Number Without Autonumber

Mar 26, 2006

I want to generate a unique Patient Number by using the first three letters of a particular field and then increment it by 1.

ie If the [CountryName] field is Australia I want the Patient ID to be AUS1 then AUS2 and so on.

I can do the first bit
PatientID=UCase(Left[CountryName],3) but how can I then add the number...?

(or maybe this isn't possible).

I need to avoid autonumbers becasue of the PDA program I am then transferring the database to.

View 5 Replies View Related

Append,Incrementing Number Problem

Oct 23, 2006

Hi All

Hope you can help, I have been looking on the forum but with no luck. I am trying to design an append query that adds any number of records to another table but need one of the fields to increment by one for each record, so for example;

I append 10 records and the other field increments from 060,061,062 etc for each record

Thanks

HITC

View 8 Replies View Related

Auto-incrementing Number That Starts Over

Nov 30, 2011

I have a table, Purchases, which has a 1:N relationship with another table, Items. Each purchase can have multiple Items.

'PurchaseID' is the primary key of my Purchases table.

The Items table has a composite primary key, made up of PurchaseID (making it an identifying relationship) and ItemID.

As you can see, I have ItemID starting reverting back to 1 each time PurchaseID increments. PurchaseID is an autonumber on the Purchases table, however ItemID is just a Number and has to be entered manually. If I set ItemID to an autonumber, it will continue to increment even after PurchaseID changes.

What I am trying to do is to get ItemID to auto-increment but revert back to 1 each time PurchaseID increments.

The entry form for both looks like this:

The Record Source of the main form is the Purchases table, and the subform is a Multiple Items Form based on the Items table. Filling out the form will create a new Purchase record with an auto-incremented PurchaseID, and a number of new Item records with that same PurchaseID, and whatever ItemID's are specified in the subform. Currently the ItemID's have to be entered manually as 1, 2, 3, etc.

Is there a way to get them to auto-increment, but begin from 1 for each new Purchase record?

View 1 Replies View Related

Custom ID With Year And Incrementing Log Number

Dec 16, 2014

Been looking around for a solution for a custom ID and can't quite find one that's specific to my problem.

I am creating a log and I want to give each new log entry a new log number. The format would be: IEyy-xxx. The ID is the letters IE, then 2digit year, a dash, then 3digit incrementing number. The ID should reset back to 001 every year (e.g. if IE14-623 is last log entry of 2014, first log entry of 2015 would be IE15-001).

My table has an autonumber that I will use as the primary key- which is not the log number- and looks like this:

These are the fields in my table:

Index Log Number (autonumber and primary key)
IE number
Program Name
Date Created

View 1 Replies View Related

Trying To Create A Multi-criteria Incrementing Number

Jul 3, 2006

Is there any way it would be possible to have a number automatically created using NZ() or DMax function; based on certain criteria and also when creating the number preventing a duplicate number creation in the even of a simultaneous record creation?

Here's my example:

I have a CCN Number (Currently the employee manually types it in; and it is the primary key. What I would like is to take out the human element (error possibilities) and let access create it for the employee.

Here is how the CCN looks and the breakdown of each section (the important part's will be the first 3 sets of numbers):

96-06-184-100-000

96 = Region Code
06 = Current Year
184 = Julian Calendar Date (based on the receipt date field)
100 = Filler number based on day of the week (Eg. Monday = 100, Tuesday =
200, etc.)
000 = Filler numbers (Should always be Zero's (000)

I need to find away to pull this information from a table of some sort and combine it to create the CCN and to then add 1 (incriment) to the 4th set of numbers. Example 100 (1st record of the day) 101, 102, 103, etc.

Any help or ideas would be greatly appreciated.

View 4 Replies View Related

Forms :: Assign Field With Special Format Based On Date / Time Format

Feb 17, 2014

I wanted to assign the field "Number of magazine" with special format based on date/time format but showing only year and month in the format: "yyyy-mm".

So in property of this field in format I put yyyy-mm and in input mask I type 0000-00;;-

I also created the form based on the table containing above field and I defined format and input mask for corresponding formant in the same way like at the table.

But if I try to type date for example 2014-01 in text box of the form it comes up with the full date 2014-01-01. Why does it do like this? What do I do incorrectly?

View 2 Replies View Related

Queries :: How To Query Number Of Records Not Common To Two Tables

Aug 9, 2013

I have two tables, identical in terms of structure (number & names of fields etc.) but different in terms of content (records not necessarily the same, some may be common to both, some may only be present in one or other table)

I want to set up a query to count the number of records which are present in one table (Table A) but not in the other (Table B) using a common identifier field, and put the numerical result in a text box on a form (i.e. use the query as the control source for the text box)

I've managed to come up with the following which provides the list of ID's :

Quote:

SELECT tblA.CommentId
FROM tblA LEFT JOIN tblB ON tblA.Id = tblB.Id
WHERE tblB.Id Is Null;

Which will come in useful elsewhere but how do I adjust this SQL to only return the number of records? I think I have to use COUNT(*) somehow but I'm not familiar with it and not sure of the syntax?

View 2 Replies View Related

Combine Datatable Rows Based In Common Value

Nov 27, 2012

i have been trying to combine data from 2 different sources, to make unique rows: here it is my situation Data in DGV already in dgv, Unbound:

column1 | Qty
"Sugar", 100
"Salt", 100
"Color", 200
"Malto", 150

Data in datatable:

column1 | Qty

"Sugar", 80
"Salt", 60
"Apio", 25
"Lemon", 60
"Color", 60

So i want a control that matches the column1 in datatable against DGV.Column1, and if value matches only add second column value and if not, then make a new row in DGV.
Final decided outcome:

column1 | Qty|Qty2
"Sugar"| 100 | 80
"Salt" | 100 | 60
"Color"| 200 | 60
"Malto"| 150
"Apio" | | 25

View 1 Replies View Related

Modules & VBA :: Copy Record N Number Of Times - Incrementing Date

Jun 3, 2015

Is it possible to copy a record 'n' number of times, incrementing the date by either days, months, weeks etc?

I have a regular payments table that will need to be edited at some point should either dates, or amounts change, but... regardless of the size of the table, it's not a problem, as these will be moved to a different table and deleted once paid.

Given the example, would it be possible to copy this record and additional 5 times, incrementing the date by one week.

View 11 Replies View Related

Queries :: Join Two Databases Based On Common Text

May 31, 2013

I am trying to form a join between two separate databases. Database 1 has a column (Gene_Name2) that consists of common names of human genes. In this database there is only one name for each gene per field. The other Database 2 has a column (Gene_Name2) that has various names for the same gene in each field. Most genes have been given different names over time.

I want to join the databases into a separate query database so that all of the information in Database 1 is retained and only when the name in Database 1 matches one of the names in Database 2 does the row of information get tacked on to the query database. The problem is that in a normal query the text in both Gene_Name columns do not match and the query returns no matches. I have tried Instr and like criteria statements with no luck. The following is an example of what I have and what I need.

Database 1

Chrom Gene_Name1 Data
Chr1 ATC XYZ
Chr2 IDH2 ZYZ

Database 2

Gene_Name2 Data
ATC;ORF34;NM_123 ABC
ORF65;IDH2 IGH

Joined Query
Chrom Gene_Name1 Data Gene_Name2 Data
Chr1 ATC XYZ ATC;ORF34;NM_123 ABC
Chr2 IDH2 ZYZ ORF65;IDH2 IGH

View 7 Replies View Related

Getting Data From Rows To Columns Based On Common Fields

Jul 30, 2013

I have a big Excel file with payroll information about employees. Per employee per date, there are a couple of rows with mostly identical data (such as the employee's home address) but 2 differences: one will have paycode A with amount B, another will have paycode C with amount D, etc. I want to simplify the file to have 1 row per employee per date: in the example given that row would have paycode A with amount B as well as paycode C with amount D, in 4 separate columns.

I think I can technically solve this by creating Excel files per pay code/amount, and then linking them together by person and date, 1 by 1, through Access. This is feasible because there aren't that many different pay codes. But still, I was wondering if there was anyway to solve my problem in Access itself.

View 1 Replies View Related

How To Assign A Row A Number? Help Please!

Jan 12, 2006

Hello! I'm trying to assign a number to a set of rows so I can, essentially, create a dual primary key on a table. Below is an example of what I have...

654321 | Course 1
654321 | Course 2
123456 | Course 1
123456 | Course 2
123456 | Course 3
123456 | Course 4
123456 | Course 5

The numbers are just "student numbers" if you will. Something that identifies them. The second column is basically the name of a course. What I would like to do is number each row, but only within the group of that individual.

Example:

1 | 654321 | Course 1
2 | 654321 | Course 2
1 | 123456 | Course 1
2 | 123456 | Course 2
3 | 123456 | Course 3
4 | 123456 | Course 4
5 | 123456 | Course 5

Can I accomplish this?

View 5 Replies View Related

Incrementing Field Value

Jan 9, 2007

Hello there, some help would be nice! Say i have a booking field. If people wanted to book a number of seats, how would i make it so that when the number of seats that was entered on the booking form was entered it would add on to the exsisting number of seats taken?

So say for film A There is 20 seats available and 4 of been booked, then someone wants to book 2 more, how do i make it so now, the number of seats taken shows up as 6 as apposed to 4?

Id like this done without VB if possible?

Thanks!

View 1 Replies View Related

How Do You Find The Most Common Value In A Field

Mar 27, 2008

I am OK with a number field as I can put it in Excel and use =Mode().

But that wont do text such as lastname, suburb etc. I can do suburb by doing postcode but no such equivalent from some others I want to do

View 4 Replies View Related

Incrementing File Name Field...?

Oct 31, 2004

Hi,
I am reasonably new to access and i am having a little trouble with what i would expect to be a simple problem to fix.

What i am trying to do is this...
I have a table set up to work with an asp web page. each record in the table has a unique ID which is set to autonumber.
I also have a field which hold the URL of an image used in the asp file. The address remains the same for all of the records except that the file name it points to increments by one each time.
example:
the record ID is 173 and the file address is:
http://www.berkeley.tv/thumbnails/thumb_173.jpg

Basically, if i could automatically take the ID number and enter it after 'thumb_' it would all work fine.

Hope someone can help me out,

Thanks in advance.

View 1 Replies View Related

Incrementing Numeric Field Value

Nov 26, 2006

I have this bit of code in a routine.
CustNum is a Numeric field with a number
I need to increase by one
With the code below It comes always as 1


Set Db = CurrentDb
Set rs = Db.OpenRecordset("Miracle_Cloth_Main", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!Name = NewData
rs!Cust_ID = NewData
rs!CustNum = [CustNum] + 1
rs.Update
rs.Move 0, rs.LastModified ' Go to new record
'Me.Bookmark = rs.Bookmark ' Go to new record
'rs.Close


Could someone help with the correct code.

View 2 Replies View Related

Forms :: Way To Assign By Design Certain Item Number To Given Control?

May 12, 2015

The code I am modifying looping through Me.controls collection to identify appropriate control types. Is there a way to influence the order (sequence) of that traversing? Or in different words, is there a way to assign by design certain item number to a given control?

View 4 Replies View Related

Field: AutoNumber, Fractional, Incrementing

Aug 25, 2005

I have a table <Table1> with field <Cust_ID> with datatype <Autonumber, LongInteger,Increment>. It means that as new record is entered each Cust_ID is auto-generated with incrementing number (that is not fraction). Now, I want to create a field that will generate incrementing fractional AutoNumber as I go on adding new record. (e.g. 1st record: Cust_ID = 1.00000001, 2nd record: Cust_ID: 1.00000002, 3rd record Cust_ID: 1.00000003)

Any help is appreciated. Thanx in advance.
Prodigy.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved