Access 2007-2013
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
 
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  
 
NEW Release: Access Advanced Level 2    dismiss

Forums     

Microsoft Access Forum
By Richard Rost   Richard Rost on Facebook Richard Rost on Twitter Richard Rost on Google Plus Richard Rost on LinkedIn Email Richard Rost

 
This forum is for the discussion of Microsoft Access.

Access is my personal specialty. Have questions? Comments? Want to discuss how to do something? Post it here. Also, I get a LOT of questions sent to me in Email from people around the world. I'll post the interesting ones in here. Feel free to comment on them.

Click Here To Subscribe to this forum and receive an email update whenever new posts are added, just scroll down to the bottom of this page and enter your email address in the comment form.

Permanent Link
Keywords: microsoft access forum
Post New Topic

Read Automatic transaction number by Steven K @ Wed 1/4
Hi Alex. Happy New Year! Thank you for the recommendation. I think the composite key will be very useful for me for some of the applications in the DB I am working on, but for the specific purpose of what I am trying to do, it will not work or at least I need to do some kind of hybrid perhaps between a composite and what I need.

For example, I am in the financial services industry. I have traders that work in derivatives, others in equities, others in fixed income, etc. I am setting up separate tables for each products area, i.e. - EquitiesTradesT, FixIncTradesT, DerivativesT, etc. For a variety of reasons (regulatory, compliance, record keeping, trade report production,daily P&L, trader commissions, etc.), I need to have a common format of a Trade ID across all product trades.

I am keeping a regular autonumber ID for each table for the purposes of relationships, however, I need the "general" TradeID to have the format I mentioned in my original post. Therefore, in each table, I will have the exact same field, for the purposes of this forum, let's just call it, "TradeID". Let's say the first trade of the day is a fixed income trade with today's date, 01/04/2017. In the FixIncTradeT, the TradeID field, it should generate the number 70041000, i.e. - "7" for 201"7", "004" for the 4th day of the year, and "1000" for the first trade. The next trade is equities. The TradeID field in the table EquitiesTradesT will read 70041001, and so on.

Tomorrow will start at 70051000, i.e. - "7" for 201"7", "005" for the 5th day of the year, and "1000" for the first trade, etc. On December 31st, 2017, the first trade would be 73651000.

I know it seems a little confusing, and quite a bit of detail, and truthfully, it seems a little complicated, but it is necessary.

Cheers


Reply from Alex Hedley:

So you can use the Day(), Month(), Year() functions passing in Date() then you could use something like Right(Year(Date()), 1) to get the 7 from 2017.

For the TransactionId you could have a Transaction table with one Field, TransactionId which is a number and every time you create a record anywhere in your db you increment this number. Now just get this number and add 1 each new record.
There could be race conditions and if multiple people are using the db at the same time it could get messy but it's an idea.
Show Just This Thread        Post Reply
Read Automatic transaction number by Steven K @ Wed 12/28
I am more or less an advanced level user in Excel, but I am relatively new to Access. I am hoping someone may be able to help me here. I work in a business that I have sometimes hundreds of transactions per day (I'm in the financial services industry). I have different tables for different types of transaction types. I don't want to mess with the Autonumber for each table, but I need to create a unique transaction number across all types of transactions. I need to create a "Trans # Field" and I need it in the following format... last digit of the year (i.e. - "6" for 2016)+ the day number of the year (i.e. - today 12/28/2016 would be 363 accounting for the leap year) + a number starting at 1000. For example, today's transactions would be 63631000, 63631001, 63631002, etc. Tomorrow, 63641000, 63641001, 63641002, etc.

Would it be possible to use an Expression in the Property Sheet or perhaps this would only be able to get done in VBA?

Thanks and happy holidays!


Reply from Alex Hedley:

How about a Composite Key?
Show Just This Thread        Post Reply

Collapse All Topics

 

Post Your Comments or Subscribe
    If you would like to be notified of new posts on this forum,
    just enter your email address below. It will be kept private.
 
If you just want to subscribe to get email updates when this forum is updated, then enter your name and email address and check the Notify Me box below. If you would optionally like to add your comments below to be posted, they are welcome.
 
  Your Name:  Required
  Your Email:  NOT Public
  Subject:
  Comments:

 

Sorry about this step. It's just to keep the spam bots away:
  Verify: What is 1+7:
  
  Notify me when the this forum is updated
  Remember Me for my next comments
  
 
 
Please do not use this form for Customer Service inquiries! If you have questions about your account, shipping info, courses you've ordered, need passwords, etc. please use the Customer Service Center instead.

I value your comments. They will be displayed on this page (above). Your name will be displayed, but your email address will not be.
As always, I promise to never give away your personal information to anyone else, ever.

NOTE: If you don't leave your name and email address, DON'T expect a reply. I can't promise a personal reply to everyone who posts here. I TRY my best, but I cannot guarantee it. If you don't leave your real name and email address, I won't even bother. I usually just hit DELETE. -Richard

 

 

You may want to read these articles from the 599CD News:

1/17/2017Microsoft Access Advanced 2
12/7/2016Access Advanced 2 is Finished
9/20/2016Microsoft Access Advanced 1
9/17/2016Access Advanced 1 is Finished
6/11/2016Microsoft Access Expert 32
6/9/2016New Access Class Finished
3/9/2016Microsoft Access Expert 31
8/16/2015Access Registration Seminar
8/2/2015Microsoft Access Expert 30
8/1/2015Access Loan Calculator
 

Learn
 
Accessindex
Excelindex
Wordindex
Windowsindex
PowerPointindex
Photoshopindex
Visual Basicindex
ASPindex
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About Us
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Gift CDs
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP