Auto Create a unique number from user data, for input into table.

Help would be appreciated, even if it cant be done
I have a table[InspectorsMaster] using Fields, ([DR_Date], (Short Date). A 
number field (Long Integer [SeqNum])I do not currently use it, and a Field 
([Employee], Text field, size set at 3). I would like to know if I could 
generate a Unique sequential Value (starting with 0000) and combine it with 
values from date, and text field that would automaticly be entered into the 
Non used Number field such as on click . This of course would occure at The 
Form level before close of the form. (Macro) or after dirty of the Date field.

Like:[Inspectors Master]![Employee] + DatePart(yy)[Insp_Mastr]![DR_Date], 
plus the random number, if possible.
Respectfully,
AB 
-- 
Andrew 
H.W. Lochner
0
Utf
2/8/2010 8:46:11 PM
access.modulesdaovba 1670 articles. 0 followers. Follow

1 Replies
767 Views

Similar Articles

[PageSpeed] 53

Andrew

If you already have values in all those fields (except sequence number), why 
do you need to (re-)store the same values again, adding a sequence number? 
(hint: you don't)

Instead, consider finding out how to generate sequence numbers (search 
on-line for "custom autonumber"), then use a query to concatenate together 
the fields you want displayed.

That way, you don't need to build yourself several more routines to 
guarantee that a calculated sequence number in a field stays in sync with 
all the pieces that make it up.

Besides, you're going to need to build that sequence number routine either 
way!

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

-- 
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Andrew" <Andrew@discussions.microsoft.com> wrote in message 
news:8A500A9A-3EDD-4F64-8768-403D203E8A22@microsoft.com...
>
> Help would be appreciated, even if it cant be done
> I have a table[InspectorsMaster] using Fields, ([DR_Date], (Short Date). A
> number field (Long Integer [SeqNum])I do not currently use it, and a Field
> ([Employee], Text field, size set at 3). I would like to know if I could
> generate a Unique sequential Value (starting with 0000) and combine it 
> with
> values from date, and text field that would automaticly be entered into 
> the
> Non used Number field such as on click . This of course would occure at 
> The
> Form level before close of the form. (Macro) or after dirty of the Date 
> field.
>
> Like:[Inspectors Master]![Employee] + DatePart(yy)[Insp_Mastr]![DR_Date],
> plus the random number, if possible.
> Respectfully,
> AB
> -- 
> Andrew
> H.W. Lochner 


0
Jeff
2/8/2010 9:16:15 PM
Reply:

Similar Artilces:

Auto Filter problem
I am using the auto filter for a particular column to sort out differen medical programs. When I click the drop down and click a program, i doesnt show me ALL the lines that say this particular program. Why is this? -- Message posted from http://www.ExcelForum.com Hi maybe some hidden characters in these lines 8e.g. additional space characters, etc.) -- Regards Frank Kabel Frankfurt, Germany "jkb724 >" <<jkb724.19rasx@excelforum-nospam.com> schrieb im Newsbeitrag news:jkb724.19rasx@excelforum-nospam.com... > I am using the auto filter for a particular column to so...

Creating linked fields
How can I create a linked field eg I have Account no in General tab and I create another tab which requires the same Account no to be present basically its the same field in the database so in the tabs it projects the same data ! when typed in the General tab ! It is not possible to have the same field displayed on more than one tab with the current version of the product. I am not sure if it is going to be possible to do this in V2. Anyone know? Guy. "Rick" <Rick@discussions.microsoft.com> wrote in message news:D7EE8552-C4F2-4143-A4C6-B9268C4CF4C9@microsoft.com... &g...

Create a Virtual Directroy in IIS through .net Remoting
Hi All, I am new in Remoting & Windows ,actual till now i had only work in Web,recentelly i change my job so i have to work on Windows.Now i have one query... I have to make a application in that Create a Virtual Directroy in IIS Through Remoting or WCF..and after that we will able to update this virtual directory Properties..So can you tell me or guide how can i'll prepare for that..Please i'll heartly thankfull to you.... Regards: Gourav Vishnoi 91-9871157845 (M) ...

Creating tables
I have a client trying to create a report. He has tables within the report that show costs on a bi-yearly basis. He doesn't want bi-yearly. He wants the table set up in bi-weekly tables, but the drop down menu doesn't allow it. He can do days, months, and years, but not weeks. That will not show up in the drop down menu. It is strange! How can this issue be corrected? ...

Excel Query to Access Database Locks Users
We have one computer on our network of computer using Office 2007, the rest Office 2003. When the 2007 version is in a Excel query pulling from the network database it locks the database. Any way to solve that? ...

Auto-Editing
Word 2003 has a very annoying default. It assumes too much! If I reformat a few words in a document, it changes the entire document to that formatting. Grr-rrr-r! I have to constantly press undo to get what I want. I know there's a feature that's causing this annoyance but I can't find it to turn it off! Can anyone help, please? See http://word.mvps.org/faqs/formatting/wholedocumentreformatted.htm. -- Stefan Blom Microsoft Word MVP "Connie Martin" <ConnieMartin@discussions.microsoft.com> wrote in message news:CD959D82-F81B-4A9D-993E-73...

Error Creating User
I have tried adding a domain user to crm using the front end but crm reports it cant find the domain account. I therefore tried using the backend (Deployment Manager - User Manager Wizard) to create the account - bearing in mind the wizard loads up the user accounts from active directory and you have to select a valid account - run thru the process only to be told at the end (80041d2a) - SOAP Server Application Faulted Which apparently means it cant find the domain account!! Any help appreciated. I've run the evironment diags with no faults found. "Dyawlak" <dyawla...

Create new Database and Configure Synchronization
Hi all, I would like to create a new database/table to save information on the Oppurtunity -> Competitor/Partner form to the local MSDE when a user is offline. When the user goes online again, I would like to set up the replication so that the data (Competitor/Partner information) stored locally on the MSDE is synched back to the CRM Database (in which case I think I'll have to add a new database/table to the CRM Datastore as well, since it does not have the table I want). Is something that can be done? If yes, anyone have any ideas of how to go about it? Thank you in advance. Defin...

Auto-Calculate
I have a spreadsheet that utilize the stock quote add-in from MSN. On a daily basis I refresh the add-in functions for the Highs, Lows, Last, Volume, etc. On occasion the spreadsheet reverts to manual caculation settings, and I have to press the F9 even after I updated the quotes. I've always preferred the any spreadsheets I open, blank or otherwise, the automatic setting selected for calculations. I consider this an annoyance. Has anyone experienced this glitch? Is there a fix for it? Ron_D Ron Excel takes the calculation mode from the first workbook that opens in a session. Sub...

Unable to Forward Meeting Requests to users on Exchange 2003
I am finally migrating my users from Exchange 2000 to Exchange 2003. This past weekend I changed my bridgehead server to a new Exchange 2003 SP2 Server I also migrated about 500 out of 4000 users to new Exchange 2003 SP2 servers. Now when users try to forward any meeting requests using either Outlook XP or Outlook 2003 they get an undeliverable message stating that they do not have permission to send to the message. This only happens when they are either forwarding meeting request to someone outside the office and it is routing through the new bridgehead server or to a user that is on one ...

Create a button to insert a new row.
I know Excel can do it; I just don't know how. In addition, once the new row is inserted, I need the formulas to carry into it. Any help is greatly appreciated! I can think of many possibilities, but I'm sure you are thinking of something very specific. Please give more information. -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Sharon" wrote: > I know Excel can do it; I just don't know how. In addition, once the new row > is inserted, I need the formulas to carry into it. > &g...

Common code DB (MDA/MDE)
I'm currently workling in a middle office environment, and I've created multiple databases for various groups, and I dislike the idea of copying code into each DB, since much of the code is generic/ wrapped modules that can be reused, I wanted to cut down on the code redundancy and consolidate in a single MDE/MDA. Are there any good references, or does anyone have any good pointers? James Igoe http://code.comparative-advantage.com/ <james.igoe@gmail.com> escribi� en el mensaje news:1191518291.004259.217710@d55g2000hsg.googlegroups.com... > > I'm currently workli...

auto copy self
How do I arrange for Outlook to automatically copy myself on every new, reply or forward email? If you mean keep a copy of all sent, see settings under Tools/Options/Email Options and Advanced Options David "rich" <steamuk@aol.com> wrote in message news:055c01c3664f$dadecd30$a001280a@phx.gbl... > How do I arrange for Outlook to automatically copy myself > on every new, reply or forward email? ...

Auto Scale Chart Macro -- Any improvements please?
This is the best way I've found to correctly scale a chart -- the only way I found to exclude a chart interpolating with #NA cells was to delete those cells containing #NA, and run the chart. This takes a long time on my computer. Wondering if there is a better way. This macro is directly taken from 2 excel mvps and modified; i believe a mehta and ron bovarty, but could be wrong. Thanks for taking a look. Sub AutoScaleYAxes() Dim ValuesArray(), SeriesValues As Variant Dim Ctr As Integer, TotCtr As Integer Application.Run "Extend_Stock_Data" Applic...

Auto correct or Auto complete
We are all familiar witht he auto correct or auto complete functions found in MS applications. Of course that means it is available in Access also. My question is this ... can this function be replicated within the DB, so that the set of auto correct items are part of the package rather than something that would have to be set up on each individual desktop system? It's use, for me, would primarily be within a memo field where medical abreviations, used as a shortcut, would convert to the true meaning as the user types them in. Ex: "prn" without quotes would change to. &qu...

Extracting data from workbooks. Help.
hello I have a situation where there are several workbooks, of variable name, contained within a folder on my hard drive. I have a master workbook in a folder higher up the same directory tree that I want to use to gather information from the other workbooks of variable names. The cell, A1, that I am interested in is on sheet "OnCall" in each of the workbooks of variable name. Is there any way that I can open the master workbook and then automatically extract the data from cell A1 in each of the other variable name workbooks? I hope that as clearer than mud? hopefully Tom Here&...

OWA auto login
I am trying to use the credentials from the forms authentication login to automaticaly log in to Outlook Web. I redirect to a URL with this format: http://UserName:Password@mailserver/exchange I have seen this example in other posts but this does not work for me. I still get the Outlook Windows Login prompt. Perry Perecli Manole wrote: > I am trying to use the credentials from the forms authentication > login to automaticaly log in to Outlook Web. I redirect to a URL with > this format: http://UserName:Password@mailserver/exchange > I have seen this example in other posts but t...

Auto look through subfolders
Please help. I can write a macro that will extract data from all excel files in a specific folder. What I need to be able to do is write a macro that will automatically extract data from excel files within folders and sub folders and sub sub folders etc For example the data is all held on the following directory: H:\development forms\2006 cost sheets\ And within that directory by customer - for example Tesco, Boots, Asda etc. These customers are then subdivided into product ranges - eg 1,2,3,4 etc and some futher subdivided by national or exclusive. All the excel files are in exactly th...

Count number of lines of text in a range/value.
To start, 1) Add a form w/ a textbox to your VBA project. 2) Set the textbox's AUTOSIZE property to False. 3) Set the textbox's MULTILINE property to False. In your code... 4) Call on the Form's SHOW method (modal or modeless is irrelevant). 5) Set the textbox's TEXT property to the (trimmed) value you are working with. 6) Set the textbox's AUTOSIZE property to True. 7) Set the textbox's MULTILINE property to True. 8) Save/get the textbox's LINECOUNT property. 9) Call on the form's HIDE method. btw, I assume no responsibility for the code. Use it at your own...

Adding users to Active Directory groups
We have installed CRM 3.0 on a server using a domain admin account. We also have a CRM Admin account on our domain that is used to administer CRM. This account is not a domain admin. We ahve noticed that when the CRM account adds a new user to CRM, the network account gets added to the UserGroup in AD. Can someone explain how that user account gets added to the AD group when the CRM admin account is not a domain admin and the site is running under Local System account? Is it still using the domain admin credentials that we used to install CRM? The CRM Admin account simply has rights to ad...

Any way to get rid of an auto-suggestion in the login dialog box, for Exchange/OL using RPC over HTTP?
A client was using RPC over HTTP to two different Exchange servers (OL prompting for profile on startup). Both profiles were set up to prompt for credentials upon connection to Exchange. There's now only one Outlook profile needed; the other is gone and OL isn't prompting for the profile selection any longer, which is fine. However, Outlook is remembering domain1\user and domain2\user in the login dialog box, and I'd love to be able to get rid of the no-longer-valid credential dropdown suggestion. (The computer is not a member of a domain and hence always needs to be prom...

Test number of decimal places in Currency format
How can I interrogate the system (Windows, I guess) to find out how many decimal places are specified in its Currency format? Alternatively, how can I test a number that's been entered to ensure that the user did not enter more decimal places than the Windows currency format permits (Access will store what's entered, but I want to reject what's been entered if it's not according to the Regional settings). Bob Randy Birch has code to give you details about the defined Locale Currency information at http://vbnet.mvps.org/code/locale/localecurrency.htm Note, though, th...

Auto date
I am trying to create a field in a form that if anything is changed on it, it will automatically update the date to current date. Is this possible? Sojaminc wrote: >I am trying to create a field in a form that if anything is changed on it, it >will automatically update the date to current date. Is this possible? Make sure the last changed date/time field is in the form's record source table/query. Then use the form's BeforeUpdate event: Me.lastchanged = Now -- Marsh MVP [MS Access] Hi - You can do this in the On Dirty event of the form, which fires as soon as you m...

Data validation with a cell value linked to the same cell.
I Think that my post name is very confusing but I'll explain. I�m doing a data validation in cell f1 usig the data validation option the value entered in cell f1 need to be equal or greatter than th value in cell b2 and cell b2 is calculated with the formula =a2+c4-f1. What I'm trying to do is to prevent to enter a value in cell f1 tha I'll make cell b2 negative. But its not working, any suggetsions??? Thanks. Rodolf -- Message posted from http://www.ExcelForum.com Change your CF criterion to Formula is = F1 <= (A2+C4) In article <rodolform.161w07@excelforum-n...

An auto reply to an auto reply!
Had the funniest situation yesterday. Somebody emailed a public folder we have set up. On there we have a rule to send a reply saying thanks for your email -someone will be with you shortly (we have to have this message on - it is for some website that recently went live). Now that auto reply went back to the guy who emailed - who must have sent it from a public folder himself (as he forwarded the original email from a public folder). The guy received our auto reply - and promptly his email system sent an auto reply to us. As is the way it is set up - our email system sent him an auto ...