Looking to see if there is an easy solution to this problem I have.
I have a table which holds order information, the primary key for this table is orderID which is an autonumber.
The field in question is order number, which has a default value of "JJO"00000, which I have started manually at JJO10001, is there anyway i can get my database to automatically increment this number to save me from keep checking the last order number produced.
Lost count of the number of times I have gave the same order number to numerous customers.
in an initials field... i want it so that it could automatically increment the 3 letters to uppercase... how? if it can't be done in a table where can it be made (i.e. in a form, query etc)
I would like to know if there is any procedure to restrict/stop auto number increment for certain number of record count (say 50), then increment by 1 for next 50 records.
I want make one database about office register. I gave primary key for auto increment serial number . That is working fine. Now problem is some times I want delete client name in between table .That is maybe first row or 5th row or anywhere . at the time the row deleted which is i was selected but the primary key is not update . for example I want delete 8th row . after deleting I not seen 8 in primary key place i have seen only ....,5,6,7,9,10...... etc. how to give auto increment and decrement in the primary key......
I am new in ms access , I want make one database about office register. That is Have done . I gave primary key for auto increment serial number . That is working fine. Now problem is some times I want delete client name in between table .That is maybe first row or 5th row or anywhere . at the time the row deleted which is i was selected but the primary key is not update . for example I want delete 8th row . after deleting I not seen 8 in primary key place i have seen only ....,5,6,7,9,10...... etc. So how to give auto increment and decrement in the primary key......
I have a form where we fill in information for supply of equipment to employees.
Each item must be signed for on a printed report.
I am encountering problems trying to create enough rows in my report detail for each signature of the items supplied.
For example, on the form I will select the "equipment" - 4 hats supplied and 3 boots. On the report I want the equipment set as the group and the detail to be a number or rows which equals the number of selected items. therefore under the Hats group heading I want 4 blank rows which are made up of 3 text boxes - Print Name, Signature & Date and another group heading for boots but with 3 lines.
I'm trying to get an invoice number field to auto generate the next number, keeping the format as "00000"...this is what I have, which gets the next number but drops the leading 0
Code:
Private Sub Customer_AfterUpdate() If Len(Me.[InvoiceNumber] & vbNullString) = 0 Then Me.[InvoiceNumber] = (DMax("[InvoiceNumber]", "[tblInvoiceNumber]") + 1) DoCmd.RunCommand acCmdSaveRecord End If End Sub
invoice numbers are 04024, 04025 etc...how I keep the formatiing?
I am working on a form and need it to be able to generate a random number to use as an invoice number. The only parameters i need it to meet is that it is at least 5 digits in length. I was hoping i could use a button to make the number generate in a separate box.
I want to know how to reset (to start again from 1) my primary key field. As an example i have the "Customers" table with the field "customerID" as PK now i entered many values (20) then i deleted them but i want to start again and the "customerID" value starts with 21 i understand that but i want a fresh DB (i was testing things) and i want to start from 1 can i? how? i even deleted the relation between this table and the other table but no success!
I want to know how to reset (to start again from 1) my primary key field. As an example i have the "Customers" table with the field "customerID" as PK now i entered many values (20) then i deleted them but i want to start again and the "customerID" value starts with 21 i understand that but i want a fresh DB (i was testing things) and i want to start from 1 can i? how? i even deleted the relation between this table and the other table but no success!
I'm trying to code for a 'duplicate record' button on a form that, as well as copying the values of all the controls of the previous record to the new record, makes a certain control (which contains a number) increment as appropriate.
There are two controls on the form which contain the start and end values of a numerical sequence (of potentially any length) e.g. the range 48-82 shows 48 in text box boxREGSEQSTART and 82 in the text box boxREGSEQEND OR the single value 99 shows 99 in text box boxREGSEQSTART and text box boxREGSEQEND is empty. In a record, the value of boxREGSEQEND would always be higher than that of boxREGSEQSTART or would be blank.
The appropriate incrementing action would be:
After clicking 'Duplicate Record' button, If there is no value in boxREGSEQEND in the record being copied, then in the new duplicated record the value of boxREGSEQSTART should be 1 greater than the value of boxREGSEQSTART in the record it has been copied from.
i.e. the record being copied is records a single item, a single value, and the next record should show the sequence moved on by one
OR
If there is a value in boxREGSEQEND in the record being copied, then in the new duplicated record the value of boxREGSTART should be 1 greater than the value of boxREGSEQEND in the record it has been copied from.
i.e. the record being copied is recording multiple items, a sequence, but the next record should still show the sequence moved on by one
I can get the duplication to work no problem, and I can get the incrementing to work fine for the first set of conditions, but can't for the life of me get it to increment when there is a range!
The logic (in my head, expressed as best I can in the macro language ) for the whole sequence of actions goes like so:
RunMenuCommandCommand SelectRecordRunMenuCommandCommand CopyRunMenuCommandRecordsGoToNewRunMenuCommandCommand SelectRecordRunMenuCommandCommand Paste If [boxREGSEQEND]=[IsNull] Then GoToControlControl Name boxREGSEQSTARTSetValueItem = [boxREGSEQSTART] Expression = [boxREGSEQSTART]+1Else GoToControlControl Name boxREGSEQSTARTSetValueItem = [boxREGSEQSTART] Expression = [boxREGSEQEND]+1GoToControlControl Name boxREGSEQENDSetValueItem = [boxREGSEQEND] Expression = [boxREGSEQEND]=Null
Which I would assume would tell the program to copy the current record, make a new one and paste the copy, then if there was a range recorded in the original, start the numbering of the new record one number higher than the end of that range and clear the way in the new form in case it also records a range, otherwise just increment the sequence along by one.
I have a daabase that I am importing via excel. I want the entries to be numbered ex: MT0001 MT0002 etc....
I would like it to promt the user for the last number(or next number in sequence) entered, then fill in the blank records with the next increment number. The prefix will also change to so eventually the user would enter into the prompt RD0001. then autofill the 140 imported records with RD0002, rd0003... etc....
I can't really make seperate fields because the MT0001 number will become a barcode and putting them seperate causes many issues.
can this be done? Any help would be great I am still a beginner but slowly learning! Thanks!
I am working on a section of code that when a user clicks a button it looks at a table called TBLVersion and increments the version number. The version number format is 1.0.1 what I need the code to do is increment the last digit by one for example to "1.0.2". I got the flowing code to work in excel but could not figure out how to translate it to access.
Like other posters, I need the default value to be the last value plus one. I am using a subform, and the field I need to increment is ITEMNUMBER for items that are ordered for a specific project.
It is acceptable to me to replace ITEMNUMBER with 1 for the first item, I just want it to increment after that.
Clearly the use of DMAX in this situation will not work as ITEMNUM would continue to increment so that any given project might have ITEMNUM values as, for instance, 357-363 when it needs to be 1-7.
BTW - if I could use the maximum value I would set the default value of ITEMNUM on my form as:
I have two tables, Articles and Versions, related 1 to many. In my Versions table I want to set up a field that will start at 0 for the first version record related to an article record, and as version records are added in relation to that same article record I want it to increment by 1, no gaps. It ideally would be editable. It will not likely count above 5.
i have a table where one column has numbers such as 6104003 and i would like another column to recogzie this number and make a new string in this format 61P04-003 ajacent to it. can i do that in a table or does it have to be a querie? and the bigger question is how do i do this :confused:
:mad: I know that there is the auto number function, however i would also like it to generate an ID with charaters. In my table theres a first name and surname.
Say for example: Harry Potter, i'd like the ID to generate HP001
then say there's another guy call Harriet Potter, i'd like the it to generate HP002 insead of HP001.
appreciate any help, and if it's impossible just let me know thanx!!!!:)