Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 24th, 2004, 08:02 AM
gazember gazember is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 11 gazember User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
3 probs...

Hi Everyone!

I have 3 problems. Please try to help if you can! (I am newbee)

1. I am making a database and of course before I will finish it I am testing it. The problem is that the Customer ID (which is set to primary key and it is autonumber) is beginnig with 0004 (because of testing with records) and I would like the finished database to begin with 0001. So how could I reset this record to begin wiht 0001??

2. I try to make the Customer ID (which is also the primary key and it is set to autonumber) to look like this 0001, 0002, 003,.. 0009, 0010,0011… 0100, 0101.. and so on.
On the format of the Customer ID I wrote this:”>> 0000” (without quotations)
My problem is that this autonumber should work this way: 0008, 0009, 0010, 0011.
But this way unfortunatelly it works this way: 0008, 0009, 00010, 00011. I hope you understand my problems. What’s wrong??

3. I have another database where the Customer Id (also primary key) should be 4digits_year_mont of registration. (Example: 0001-04-01; where 0001 stands for the code/number/id of customer, 04 stands for 2004 and 01 stands for January. What I would like is that the code/number/id section should be increasing automatically and the other part of the ID (year and month) should be changing (manually or automatically) with the dates.
Example: if today is 2004 february of 14th and this is my 214th customer the Customer Id (automatically) should be set: 0214-04-02. Can this be done with ms access or not??

Thanx a lot in advance and have a nice weekend!!

Reply With Quote
  #2  
Old January 24th, 2004, 10:20 AM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 280 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 15 m 10 sec
Reputation Power: 6
1. By compacting the database (available from Tool menu database compact) you can reset the autonumber.

2. If you want your own format for primary key (like 4 or 5 digits) Use just number (long) format and increment the primary key by coding which is more flexible.

3. You can increment a part of the value by 1 by using substring equivalent command Mid()

LastNo = "2001-05-300"
NextNO = Mid(LastNo,1,8) & (Mid(Lastno,9,3)+1)
__________________
V.Subramanian

Reply With Quote
  #3  
Old January 26th, 2004, 09:28 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
I would do number two different from supersuba
I would keep it as auto number and just reformat the number when displaying it with the following code

Format([auto],"0000")

This will be easier for you.


AS far as number three I would just personnal go about it different. I would treat each seperate part of you customer number field as seperate indivdual fields that would be a three part, concatenated Primary Key.

This would give me the flexibility to hadle each field seperately and would simplying the code invlolved in making the system do what I need it to do.

There really isn't right or worng answers as much as what is you preference.

S_

Reply With Quote
  #4  
Old January 26th, 2004, 10:15 AM
gazember gazember is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 11 gazember User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
where to paste it?

Hi sbaxter!!

Thanx for your reply!

The only problem is that I really dont know where should I paste the: Format([auto],"0000") code!

Please tell me!

Thanx!

Reply With Quote
  #5  
Old January 26th, 2004, 10:34 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
How do you want to use it? In query, in code, in your textbox (on a bound or unbound form)?

S-

Reply With Quote
  #6  
Old January 27th, 2004, 01:10 AM
gazember gazember is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 11 gazember User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I guess I would use it in my textbox.... since I cant code!
thanx

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > 3 probs...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway