There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Business Applications
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Acces 2003


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
whschimmel's Avatar
Junior Member with 8 posts.
 
Join Date: Jul 2008
Location: Netherlands
Experience: Intermediate
07-Jul-2008, 10:54 AM #1
Solved: Acces 2003
Dear Sir/Madam,

I'm creating a database for the registration of all our contacts with our customers.

I would like to create a call number for every contact, this call number has to excist from:

customer number + year + month + unique number. This means something like this:

851000-2008-07-00001 (withouth the '-')

Does anybody know how?

Greetz,
Wouter
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,370 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
07-Jul-2008, 11:11 AM #2
Wouter, it requires VBA code to do this.
You would have the VBA code in the in the Data Input Form in a Field's "After Update" event procedure.
Does each Customer need the "unique number" to be in sequence or can it just be in sequence accross all Customers.
__________________
.
.
OBP
I do not give up easily
whschimmel's Avatar
Junior Member with 8 posts.
 
Join Date: Jul 2008
Location: Netherlands
Experience: Intermediate
07-Jul-2008, 11:25 AM #3
It may be a sequence across customers
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,370 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
07-Jul-2008, 11:54 AM #4
You will have to be very careful with this field, as the Number it would produce
85100020080700001
would be very large and may not display properly, it may be necessary to produce it as a Text field where adding the "-" would make it more readable.
It displays as
8.51000200807E+16
__________________
.
.
OBP
I do not give up easily
whschimmel's Avatar
Junior Member with 8 posts.
 
Join Date: Jul 2008
Location: Netherlands
Experience: Intermediate
07-Jul-2008, 01:08 PM #5
When adding the - character makes the code (and so the database) more workable, it isn't a problem.

But can't the eventual code (851000-2008-07-00001) be created as a text field? That way the number won't be shown as 8.51000200807E+16. Or is it like an autonumber field always generated as a number?
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,370 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
07-Jul-2008, 01:18 PM #6
Yes it should be a text field, and you can have the "-" or not in the text field, that is up to you.
Is it possible to post a copy of the database?
It does not need any data in it, I just need to see the Field names and the data input form.
__________________
.
.
OBP
I do not give up easily
whschimmel's Avatar
Junior Member with 8 posts.
 
Join Date: Jul 2008
Location: Netherlands
Experience: Intermediate
07-Jul-2008, 01:40 PM #7
I've added my database. The code has to be generated as the Call-ID field in the tbl_Melding and FORM_Melding.
Attached Files
File Type: rar db1.rar (69.9 KB, 4 views)
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,370 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
07-Jul-2008, 02:11 PM #8
Ok I will post something tomorrow.
whschimmel's Avatar
Junior Member with 8 posts.
 
Join Date: Jul 2008
Location: Netherlands
Experience: Intermediate
07-Jul-2008, 02:30 PM #9
Many thanks in advance!
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,370 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
07-Jul-2008, 03:04 PM #10
Is Customer Number actually DealerID?
whschimmel's Avatar
Junior Member with 8 posts.
 
Join Date: Jul 2008
Location: Netherlands
Experience: Intermediate
07-Jul-2008, 05:01 PM #11
the customer number is the field 'Dealercode' (851000)
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,370 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
08-Jul-2008, 05:47 AM #12
Wouter, are there already records in the database that will need the "Call Number" converted to the new Format?
whschimmel's Avatar
Junior Member with 8 posts.
 
Join Date: Jul 2008
Location: Netherlands
Experience: Intermediate
08-Jul-2008, 05:53 AM #13
no, it's all test data
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,370 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
08-Jul-2008, 07:19 AM #14
Wouter, this version has the simpler Customer CallNumber just incrementing for all Customers, you can have it incrementing seperately for each Customer as well.
I have taken the liberty of tidying up your Forms a little and setting the table Relationships for the Tables that supply data to the Melding Table via Combo boxes, to do so I changed the Fields in the melding Table from text to Number type Integer to store the StatusID and UserID rather than the text.
On the Melding Form I have left the dealercode field visible, it does not need to be, it is only there for the VBA code to use.
The VBA uses a New Query called Que_CallNumber.
Attached Files
File Type: zip db1 v 0.1.zip (48.6 KB, 2 views)
__________________
.
.
OBP
I do not give up easily
whschimmel's Avatar
Junior Member with 8 posts.
 
Join Date: Jul 2008
Location: Netherlands
Experience: Intermediate
08-Jul-2008, 10:00 AM #15
Tnx
Thank You! It's working. You saved me hours of searching!!
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:56 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.