Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS ACCESS & have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for

Sponsored Links:

Related Messages:
Generate Custom Id Field
Hello Again,

I have an ID field that I want a custom ID generated based on Name, Phone Number & Record Number.

Here is the code I'm currently using....

'User moved out of supplier name field
Public Sub SupplierName_LostFocus()
If Me.NewRecord = True Then 'If user adidng new supplier
SupplierNameTemp = UCase$(Left$(SupplierName, 3)) 'Store 3 characters from supplier name
End If
nd Sub

'User moved out of suppliers phone number field
Public Sub SupplierPhoneNo_LostFocus()
If Me.NewRecord Then 'If adding a new supplier
supplierPhoneNoTemp = UCase$(Right$(SupplierPhoneNo, 4)) 'Get 4 right characters of phone #
End If
End Sub

I then have a procedure which combines the two strings such as....

Private Sub GenerateSupplierId()
End Sub

The problem is when I check the SupplierPhoneNoTemp & the SupplierNameTemp within the GenerateSupplierID procedure. The contain no information meaning the SupplierID will have nothing as well.

However, when I check SupplierNameTemp within the Public Sub SupplierName_LostFocus() & SupplierPhoneNoTemp within Public Sub SupplierPhoneNo_LostFocus(). They both contain the proper info. It seems they loose this information when moving outside their procedures.

Does anyone know why this would happen & how I could fix this?


View Replies !   View Related
How To Generate A 4 Digits Long Autonumber!
Hi all,

here's me again,

I have a question, I'm trying to generate an autonumber but of 4 digits, for example
the first one is: 0001 and autonumber 100 is: 0100, and so on

how can I do that?

any help will e very much appreciated!

Best Regards

View Replies !   View Related
Custom Autonumber
I am in the process of developing a DB for work. The DB is used to track incident reports and lost/found property reports.

I was interested in using 2 custom autonumbers for 2 different reports within the same DB. I would like to use the format of "I" for an incident report, "F" for the found property reports. So when I start a new Incident report it would generate the following number; "I05-03-001" The "I" specifing that it is an incident report, "05" for the current year, "03" for the current month, and "001 as the next sequential number for the reports for that month.

Does anyone have any suggestions on how I can get this done? I would very much appreciate your help.


View Replies !   View Related
How Do I Create A Custom Autonumber
I currently have a few tables that use an autonumber as the primary key, however, I would like the autonumber to start with a series of letters if possible. For example: instead of it creating an ID of 1, then, 2, 3, 4, and so on, I would like it to append lets say "ABC" to the front of it; ABC1, ABC2, ABC3, etc.


View Replies !   View Related
Primary Key...Autonumber Or Custom?
Just a general question...
When you make a primary key is it better to use and Autonumber or a Custom one? I have for the most part used auto...easy, convienient and well I have never had a problem yet (been pretty serious on Access for about 1 year). But I just read that ref integ doesn't work on Autonumbers? which would also mean cascading update & deleting correct?
I have looked at Northwind Access sample and all except "Customer" they use Auto. Well then to make a custom Primary field wouldn't I have to do that at the form level? like "CustomPrimKey = Left([CustFirstName],2 & Left([CustLastName],2) & [PriKeySetAtAutoNum]" or something like that to get what I want. I imagine you would automate this as opposed to letting the operator manually enter them.
And then as in the Northwind sample how do you know which tables need the custom numbering and which ones don't.
As I have learned on my own some of the "basics" elude me until they come back to bite me.


View Replies !   View Related
Bounded And Translated Custom Autonumber
I was hoping to run this by you guys to see if I'm doing anything horribly wrong. I have done a number of searches related to custom Autonumbers and I think this is okay but any suggestions/confirmations would be greatly appreciated.

I want to create a random Primary Key that will also be used as an item #. I know that in many cases this is frowned upon *but* I do not need the number to hold any significance I just want it to be unique. However I want to represent the item # as a set of 6 Hex digits so the standard Long Integer is too large. 16^6 = 16777216. No 0 index so 16777215.

I create my own bounded number with a macro (=Int(Rand(16777216-1))+1 )and put that as the default value. It is indexed and set to no duplicates. Is this correct?

When I display the field in a form or report I call a module which translates the number into Hex and appends leading zeros. I am currently having a problem where inserting a new record does not display the translated index correctly, but after it has been inserted it is fine.

If you have any comments or suggestions about how this could work even better (or if this wont work at all!) please let me know.

View Replies !   View Related
Generate E-mail
I've searched the site and haven't really come up with an answer for this. I have a Report that I want e-mailed to two people every 10 days. If someone could give me a direction to start in, it would be appreciated.

View Replies !   View Related
Generate Many-to-many Relationship
I have a single table called "Books". One column is "Book title" and one is "Author(s)".

One author may have written several books, and one book may be co-authored by several authors.

It should be ok to use the analyze function to normalize the table into 3 tables. (autors, books and booksauthors_xref)

The problem is that the Authors-column contains one or more autors separated by ;

When I use the analyze function I only get the first autor in the join table. Since authors "AA ; BB" are treated as one, not to entities I had to split the field into a "co-autor" column and manually add one and one co author.

Is it a smarter vay to do the normalization?

View Replies !   View Related
Generate Values
I have this kind of problem... I have ODBC linked TABLE Process_Flow and that have fields Jobnumber and quantity. Then other TABLE is Orders, where is fields orderID, deliverday and amount. I have to somehow to be able to count how many jobs I need from Process_Flow to fill out Orders.

I tried to count cumulative sums, but that didn't worked because I can't create relationships between these tables. I think that I need to do code which generates new field to this Process_Flow table (or to the new table) like Jobnumber, amount and OrderID. Where it's first search Orders table and count how many jobs it's need to fill out this order. Also it should do this everytime database is opened because Process_Flow quantity can change if it comes faults.

Any ideas?!?


View Replies !   View Related
Number Generate
hey, where can i set or how can i make the access automatic generate the the number. like i want it start from:

Account number: Ra-b200
Account number: Ra-b201
Account number: Ra-b202


View Replies !   View Related
How To Generate A Report In Vba ?
I want generate and load the report using vba when a command button is clicked . (automating the report generation)
For example i have table in access that has name, address and email fields and onced command button is clicked the report is
generated and loaded.I be happy if some one show me wprking example.Thanks

View Replies !   View Related
Generate A Report Via VBA?

I have the following very general question, but I hope you can give me a few hints so I can start and find things out on my way.

I just created a database which via VBA procedures runs all kinds of queries and puts the results in tables, for instance I have about 20 tables now with 10 fields each and for every table I want to run the same type of report.
I already made one report for one table via the report wizard, I would like to use the layout of this table for all other tables using a VBA code, so when I run this code it will create all these reports for me.
What is the best way to start?

Many thanks!

View Replies !   View Related
About Auto-Generate A Number
can I make a field that can auto-number which the format that I want??

As I know that there is two format for auto-number
but I don't like them

I want to number my own format


XXX is the category number that would be selected in the form connecting to table
YYYYMM is the date year and month
ZZZZ is another auto numbering

Can I do so

View Replies !   View Related
Generate A String From Another Number
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:

View Replies !   View Related
How To Generate Employee Code
I have to generate unique code for each person in an Employee table. This code will not be the primary key for this table. Primary key is an auto number. This Unique code is for refering to each person in all the correspondence/document/everywhere and every person will know his code and refer in all the correspondance.

I want to make a column in this table for this code. There can be two criteria for this code generation--

1. The code will be First alphabet of first name followed by sr no for that letter in 4 digits. Say Mr. Andrew is 99th person with alphbet A then his code will be A0099. Or Miss Jany is first person with letter J, her code will be J0001.


2. The code will be a five digit 7 digit number--of which the first 4 digits are year of joining in organisation and remaining 3 digits are joining serial number of this person in that year.Say Mr. Andrew is 12th person who joined in 1996 then his code will be 1996012. Or Miss Jany is 118th person who joined in 2000, her code will be 2000118. For this I will add two columns namely Joining Year and SrNo in this Table.

I want the Access, by some means to generate this code based on the above critaria in one table.Can you people help me with the ideas about achieving this task. Presently we are manually assigning these codes.

View Replies !   View Related
Help Plz, How Do I Automaticlly Generate An ID Number?
: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!!!!:)

View Replies !   View Related
Generate Email With Autosignature
I've looked through the forum, but not been able to find answer. I have code in a form that will open up new Outlook email to a contact, but I now want to be able to put the autosignature on the email. Any help appreciated.

View Replies !   View Related
Generate New Rec. In Another Table On Error
I'm a novice in fact this is my first serious try at creating a database. I'm setting up a database to track contracts both potential and active for marketing. This will be converted to a SQL when I have it finished. I have a customer table setup in the fashion of a contact list. Most of my forms need to access the information in it via a list box. I want to set these list boxes to generate a new record in my customer table if the name that is entered is not currently in that list. By using the event option "On not in list" I'm able to get the form for the customer table to open but when the new data is saved and the Customer form is closed the information is not available to the list box. How do I get it to update the list box without having the user start from scratch on that particular form?

View Replies !   View Related
Generate Word Document
Hello all,

Is there a way that I could put a command button on my form and on clicking it, it would generate a word document (I have a word document saved) but on the word document, it would populate the address field with the information on the form. I have about 5 fields on the form that will be used in the word document.

I thought about creating a report in access instead, but I might want to edit the word document manually, is there a way to do this?

Thanks much.

View Replies !   View Related
Generate A Function Through Access
I have a talbe called LOOP in access. The fields in it ar appl,sales_table,title_code,and passalong.

From this table i want to autogenerate sql and run them in a vb function through access.

My first step was crating the sql. I did it using this query.

SELECT "DOCMD.RUNSQL "&"'"&"SELECT tsr,title "&title_code&" ord_time from "&sales_table&"'"

This generates the following vb command:
DOCMD.RUNSQL "SELECT tsr,title,q2_title,ord_time from appl_sales"

The genrated sql will be a insert into query but this is just an example.

Now this will give me the sql that i want. But I have no idea how to get that into a function.

Basically say it generates 10 different vb commands i need that to run as one function. Is there a way to do this through Access and VB.

Any help would be greatly appreciated.


View Replies !   View Related
Generate New Patient ID Number
I am working on a database for our health services office, which includes a table "Tbl_Patients"

THe Key in this table is a number the office will enter. They have an ID number for existing patients that they will use when they come in.

However, should a new patient come to the office, they would like for the database to assign a new number, the first one starting at 4000.

I would like to put a command button on the new patient form that says "Assign Number" and have that number generated and used as the new ID.

THis may not be real clear, so ask if you have any questions

Thanks in advance!

View Replies !   View Related
Auto Generate Number
Hi i am new to Ms access, and i wanted to know how i could go about to create an auto generating number field that contains letters and numbers, e.g. a computer serial number.

Your help would be most welcomed

View Replies !   View Related
Dynamically Generate Content On Forms
Does anyone know of a way to dynamically fill the content of a form at runtime. I want, for example, when a user clicks a button, a textbox is dynamically added (but I would prefer not to use hidden objects). I've tried the "CreateControl" option but I can't seem to get this to work. Any coding examples would be much appreciated.

View Replies !   View Related
Generate Random Reference No. For A Record
is there anyway to have the database autogenerate a random 8 digit reference number for each record.. this of course must be unique..

maybe something like

7C7CYU99, or HJUHU889... im sure you get the picture.

View Replies !   View Related
Generate A Report/form By Category
Hi everyone,

I am tring to generate a report or form, its generated by a combo box, which list all the categories of the products, when the category is clicked on it will generate the report or form showing all the products for that particular category. Can anyone point me in the right direction? Any help would be appreciated.

View Replies !   View Related
How To Generate Random Or Sequance Number
Hi All,

I'm designing this database, in which, I have to give each record a unique random (or sequance) number of 5 digits, giving that the first digit must be retrived from another field.

Please Help, I need this ASAP!

Any help will be very much appreciated!


View Replies !   View Related
Automatically Generate Number And Increment
Hi There

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.


View Replies !   View Related
Query Generate Data Into Table
I create a query from different tables. With an website based insert statement I put the data from this query to another table.

Is it possible to fill the table without the insert statement. But automatic done by the database itself. So insert/update all the query data automatic into the table


View Replies !   View Related
How To Generate SQL Insert Script From SQL Server
Hi All,

First of Sorry, becuase I am posting off topic. I have 2 databases. One in Access and another in MS SQL Server 2000.

DTS Import Export wizard transfers the data between Access and SQL Server well. I am able to get the SQL Scripts for "Create Table", but How to get the SQL Script for "Insert Into Table ..." ?

Can any one please help me out to solve this problem? :confused:

Thanks a lot in advance,



View Replies !   View Related

Copyright 2005-08, All rights reserved