Creating An Autonumber To A Specific Format

Oct 19, 2006

I need to create an incrementing number to be used as a primary key in a table, based on a few variables. The format will be YYMM0000. It represents the number of units received each month.

I can come up with the formula to create that string no problem, but I need to create some code to check the table MAIN for the field TRACKER_ID to find the last number and increment it by 1.

Can anyone help? :confused:

View Replies


ADVERTISEMENT

Format Of Autonumber

Apr 21, 2005

I have two forms which contain entries which have an AutoNumber field, the tables and hence the forms are not related. Both the AutoNumbers have a format associated with them so when the user sees them in the form they look like:

ABC001 0r XYZ001

Both forms also have a date in them. I have set up a union query that checks both sets of data and displays any in separate form which fit my search criteria. The problem is that I lose the format of the field. In other words I just see 1 and 1 rather than ABC001 and XYZ001, so the source of the data can not be identified.

Does anybody no of a way that I can keep the format of these fields after I have run the query?

Many Thanks
CumbrianCanary

View 9 Replies View Related

AutoNumber Format

Jan 7, 2005

I want to create an AutoNumber (pkey) that is comprised of today's date, the letters CPQ (Custom Paint Quote) and have it increment by one for each quote entered that day. Ultimately, if I were to create 2 records today they would read: CPQ010705-1 and CPQ010705-2. Then tomorrows quote would be CPQ010805-1.

First of all, can you create autonumbers with custom formats? And, if so, how do I create the format?

<I know, I ask a lot of questions!>

View 3 Replies View Related

Autonumber - Specific Start

Oct 20, 2006

I Have Chosen To Use Autonumber, But I Do Not Wish To Start From Number 1. I Wish To Start From 2345.
How Can I Do That?

View 2 Replies View Related

Creating A Primary Key With Autonumber

May 4, 2007

Any ideas on tagging my primary key (currently autonum as a data type) with an "M" on the front of it. I guess i wanted to keep it as autonumber so i wouldn't have to key in a value

Thought maybe i could create a new field and do an "M" & [ID] in the default value where [ID] is the autonum primary key field but I guess I'm not doing it right - get an error trying to save saying it can't find the field [ID]


thanks for any suggestions!

View 5 Replies View Related

How To Make Autonumber Begin From Specific Point?

Jul 31, 2006

Hi, I am hoping someone can help with this problem.

I have a table which has an autonumber field, set to increment by 1. I would like this to start not from 0 but from, say 1000. Is this possible? Thanks in advance!

View 2 Replies View Related

Control Format Of Autonumber When Database Is Replicated

Mar 29, 2007

I have created a design master of my database, i want to share it on more than one PC but add data from both whilst keep developing it.

I have noticed that after replication that the ID fields now use really long random numbers and am wondering whether anyone has been able to control the 'randomness' of the autonumber?

Reg...

View 1 Replies View Related

Tables :: Creating ID With Text And Autonumber

Dec 1, 2014

My database exports data to one of our customers who then inputs the data into their system.

One field i have is "RO Number" which i have as an autonumber which works for the purposes of my part of the system.

However they have it set as "RO9999", (Their system has been set up for years, we are a new "branch") but they aren't in access.

They want the RO number to be a running serial from RO30000, RO30001 etc

The data in entered on a form.

View 3 Replies View Related

Tables :: Creating PK With Calculated Autonumber To Create Relationships

Sep 24, 2012

I am trying to create four tables: Company, Contact, Activities, and Opportunities.

I want them to relate hierarchically. A Company can have many contacts, contacts can have multiple Activities and Opportunities. But you can't have contacts without a company and you can't have Activities and Opportunities without having a contact. I want all PK's in all tables to link to one another, that you cannot create one without the other.

How I can do this in Access 2010?

YYMM00000-000000-A0000
CompanyID-ContactID-ActivityID
or
YYMM00000-000000-O0000
CompanyID-ContactID-OpportunityID

View 1 Replies View Related

Query Phone Is Specific Format

Jan 11, 2006

I need to query a table for phone numbers that do not meet the following format: ###-###-####

Any idea on how I can do that??

Hope someone can help!

View 1 Replies View Related

Printing Parts Of Records In A Specific Format

Oct 27, 2005

i've created a database for city permits to be issued (which works perfectly thanx to alll your help), but now i need to be able to print out 1 permit at a time when it is issued (immediately after the data has been entered into the forms). i have 3 tables & 3 forms: contractors/owners, permtOrders (which has tabs for the different types of permits), and permitOrderDetails. the problem is the forms are set up for data entry (and only open in add mode for obvious reasons)...i need to be able to print an actual permit (like the carbon copy, landscape kind that usually tears out of a book). once the user enters the information into the forms, i need a little bit of that info from each form to be carried onto the actual printable permit. i'm not really sure how to accomplish this. :confused: i don't really know if i explained this right, but any suggestions are greatly appreciated.

View 6 Replies View Related

Modules & VBA :: Return Next Primary Key Value Which Is In Specific Format?

Jul 26, 2013

what is the best/cleanest way to return the next primary key value which is in the format yyyy-###.These are case files for the current year, ### being 3 digit number incremented by one for each new case.

I could use a function that finds the last one, checks the date, increments by one and returns it, but maybe I could use a public property or a class? I'm keen to use classes more for code maintenance.With a class then: would i create a PrimaryKey variable of the class type/object, so when I need a new key I would just type PrimaryKey.NewKey, for example?

View 5 Replies View Related

Need Help Creating A Query Using A Specific Critiria, THANKS!

Dec 27, 2005

Hello,

I was wondering if it was possible to show data sorted by date. But I only want to see the dates that are before another date in a different table. Is that possible? (So two tables of data; one date is on the first table, the other is on another table)

Thank you.

View 5 Replies View Related

Forms :: Creating A Specific Relationship

Nov 18, 2014

I have started a new project where I have tables of people, organization, and roles, as well as one that is supposed to contain the relationships among them. In all four tables there is an AutoNumber ID field as the primary key. The fourth table, the relationship table, has as foreign keys, the primary keys from the first three.

I have created a form with a combo box for each of the three main tables. The intent is for the user to select a person, an organization, and a role, and then click on a button control that will create the relationship in the relationship table. What I am trying to do in the code is, using an AfterUpdate event procedure for each of the combo boxes, open the appropriate table as a recordset, find the selected record, and set a form-local variable to the value of the ID field for that record. So far, I can't get past the first combo box. Here is the code I have written, including both the form variable declarations and the AfterUpdate code:

Option Compare Database
Dim personID As Integer
Dim orgID As Integer
Dim roleID As Integer
Dim rsPerson As Recordset
Dim rsOrg As Recordset
Dim rsRole As Recordset
Dim rsRel As Recordset

[code]...

The error message I get is Compile error: Object required, with the personID reference in the last statement highlighted. (qryPerson is a query based on tblPeople that combines first and last names into LNFN.)

View 1 Replies View Related

Forms :: Show Date In Specific Format In Message Box

Jan 6, 2015

I have a messagebox and want to know if it is possible that the messagebox give me a date as 15/01/2015 and not 15/01/2015. Using dailog box as messagebox

Code:
Private Sub Save_Click()
Dialog.Box "Tape # : " & Me.Tape & vbCrLf & "Sticker # : " & Me.Container1 &
vbCrLf & "Book # : " & Me.Book & vbCrLf & "Date send Out : " & Me.DateSendOut &
vbCrLf & "Date to be back : " & Me.DateToBeBack & vbCrLf & "OS : " & Me.System, ,
"Saving............."
End Sub

View 5 Replies View Related

Modules & VBA :: Convert Table To Specific Text Format

Feb 17, 2014

I have a problem in converting the content of a simple table to a text format I need for an other program. The table is containing 3 columns

- ITEMID
- COLOR
- MINQTY

How do I convert the table to a text format with below format.?

ITEMTYPE is all ways >P<

How is this text shown. Do I make a kind of report.?

I have attached the two document (Text format and DB)

<INVENTORY>
<ITEM>
<ITEMTYPE>P</ITEMTYPE>
<ITEMID>3622</ITEMID>
<COLOR>11</COLOR>
<MINQTY>20</MINQTY>

[Code] .....

View 1 Replies View Related

Creating Online Format Of Database

May 25, 2005

I currently have a database on my hd and four other ppl have a copy on theirs. (We are in different physical locations which makes it very slow to put the database on our server).
Currently eveyrone is sending me files that i upload to my copy of the database so i have all of their data.
the obvious setbacks to this is that the data is not live and some of the changes might be missed etc.

i would like to move this and house the tables on my company's intranet

what would i need to do to accomplish this?

View 1 Replies View Related

Reports :: Creating A Pie Chart Format?

Apr 20, 2013

I have browsed a few forums and am still having trouble creating a pie chart that has the proper layout that I would prefer.

I have created a query that will list the data I would like to organize into a pie chart. The query, when run, will prompt the user for a start date and an end date and then display the data in this form:

EmployeeX | SumofProject hours | SumofDemo Hours | SumofAdministration hours | SumofEtc hours (5 other categories of hours)
EmployeeY | SumofProject hours | SumofDemo Hours | SumofAdministration hours | SumofEtc hours (5 other categories of hours)

OK, now that I have the data in this format I would like to create a report that includes tabs for each employee, each tab will have a pie chart that has one employee and a pie chart showing how their hours are allocated to each task. e.g. tab 1 would have Employee X and the pie chart would show what percentage of this employee's hours was dedicated to project/demo/admin/etc...

View 1 Replies View Related

Creating Custom Date Format After Import

Aug 28, 2004

I am stumped: After importing from an outside source (an excel spreadsheet) I have to change the short-date format
that I have just imported into a very specific custom format: "yyyymmdd" Ex: 20040828. How do I convert into this
new format? Help will be greatly appreciated...

View 1 Replies View Related

General :: Creating Password Protection On Specific Tables?

Sep 20, 2012

I would like to know if I can create a password protection on specific tables. Within my database, there are certain tables and/or reports to be view by a selective amount of personnel. Can I password protect just that view?

View 2 Replies View Related

Forms :: Creating Duplicate Record With Specific Fields Blank

Jul 21, 2014

I'm working on a form with almost a hundred various fields (it's what my employer needs). He wants to be able to create new records with much of the same information as the old ones by clicking on a button that will copy the information to a new record, then clear certain specific fields (or some process that will safely create the same result). I don't need specifics on how to write the same line of code for each and every field I wish to clear.

Say I have a form with 5 fields: part_number, part_owner, procedure, file_name, and date.

How could I copy the record to keep the fields part_owner and procedure the same, but clear part_number, file_name, and date?

All of the fields are from the same table (no, it's not normalized...).

View 14 Replies View Related

Modules & VBA :: Creating EXE Or BATCH File That Executes Specific Excel Macro?

Jan 27, 2015

Is there a way to create some sort of an EXE or BATCH file in any Windows Explorer folder, that executes me a specific Excel Macro?

My problem is that I got several files split up by Departments, updated every day.

So far I have to open each file and update the format.

It would make my life much more easier if I could just run a file that opens each file and applies a format to them.

View 1 Replies View Related

Queries :: Converting CSV File Into Text Format - Export Records With Specific Series And Date

Jun 7, 2015

I have a CSV file and want to convert it in a text format with some filtered data and with some formatting. This is an everyday task for me. So I made a table and imported the data in to it by the command :

DoCmd.TransferText acImportDelim, "fo Import Specification", "fo", FileName:="C:UserswelcomeDesktopfo.csv", HasFieldNames:=True

Actually I have a column "SERIES", contains various series like "EQ", "BE", "DR", "BZ", "D1" and so on. And one more column with the dates having 4 / 5 current months dates and one next months date and one next to next month's date. And every date has got several thousand records.

now the issue is that : After importing these several thousand records, I want to export it but with a specific date and with a specific series.

The other thing is that, these dates change every month so if hard coded, the problem will occur the next month.

I use this code for export :

DoCmd.TransferText acExportDelim, "NewFnoSpec", "fnoquery", "C:UserswelcomeDesktopFO Output.txt", True

this code is working fine but when the month will change, the code won't work.

Can we have a date & series picker attached to this query, so it can export the records with the specified SERIES & DATE.

I tried putting a textbox on the form named TxtDate and in a Query ( Design mode ) under the date column, in criteria I have put [Forms]![Futures]![TxtDate] and after putting this line, the query becomes empty and no data is there.

View 14 Replies View Related

Creating A Report That Conforms To ASCII Format Of Another Data Collection System

Aug 30, 2004

I have a need to convert the export of an Access report to an ASCII file.

The export needs to have a specific format - described below:

Field Position | Field Length | Field Name | Field format

1-6 | 6 | Member # | text - right justified
7-12 | 6 | Trans Date | YYMMDD
13-15 | 3 | Pay code | Alpha/ NUM - Left
16-26 | 11 | Amount | -9999999.99 (*)
64-71 | 8 | Check # | Right

general comments and questions:

This report needs to interface with some sort of transaction accounting system - No Idea what it is, but this format of the report will interface.

The field positions go from 1 to 73. I need only supply the data above, so the check # is way out of sequence. Do I need to have the space inbetween "Amount" and Check Number in the report? Will a simple text file work with all the fieds together? or will I need the space in there? Is there a way to design a report in an ASCII format in access?

Specific Questions

I think I need to change the format of the amount and date fields. I am currently using the short date format 8/30/04, but need to return the date as YYMMDD - 040830. How can I change this format to reflect the ASCII format. The form is also set with the default "=Date()" so the user doesn't have to enter the date everytime - it can also be edited for older data. I would like the date to appear the way it is on the form 08/30/04 but get entered to the table as 040830. Is there a way to do that?

The amount field is odd - I'll include the exact criteria that is desired:

"All Amount Fields must be right justified and space filled. If the amount is a credit, show the "-" sign at the beginning of the number. Payment should be entered as positive amounts. If zero, assign the fied as 0.00 (space filled)"

Is this just a mask that needs to be added? Currently, The field shows $7.00 when 7 is entered to add cent, you must type in 7.50, tab will put in the "$". I need to get rid of the $ and space fill the field?

Any help would be great

View 1 Replies View Related

Creating Dynamic Hyperlinks - Open Data Entry Form And Navigate To Specific Record

Nov 28, 2011

I have a form that lists records in a table. I would like to have a hyperlink beside each record that will open the data entry form and navigate to that specific record. Right now, the use can only open the form for all records and has to use the record navigation buttons to find the desired record.

View 1 Replies View Related

Controlling Autonumber Field - Start Autonumber From 1 Everyday (Composite Key)

Nov 21, 2013

I have two tables linked to each other in one to many relationship. Instead of auto number, the date and shift (Text) is being used as the primary keys (Composite Primary Key). Here is the tables structures,

Payouts Table:
Date: Primary Key
Shift (Day or Night) : Primary Key

Bills Table:
Date: Primary Key
Shift (Day or Night): Primary Key
Autonumber: Primary Key

The tables Payouts and Bills has one to many relationship. One payout row can have many bills. The problem is that I want to start the Autonumber in bills table everyday from 1. As date and shift are different for every day so even if i start bills from 1 everyday, it wont make same primary key. I can do it manually but I want to make it automatically.

View 4 Replies View Related







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