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 October 29th, 2003, 06:14 AM
triona triona is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Galway, Ireland
Posts: 2 triona User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
adding new records via forms....

Hi. I have a simple db table which holds a code(autonumber) and distributor name, address etc. I have a form which allows me to add new records to the table. My problem is that when i click on my 'add new record button' on my form, i'd like the 'code' textbox to automatically display the next autonumber after the last one in my table ie i want new distributors to be automatically assigned a code. can someone please tell me how to do this??
Cheers

Reply With Quote
  #2  
Old October 29th, 2003, 09:42 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
Let me make sure I understand you correctly:

You have a table that has a fieldname of code that is set with autonumber as the field type and the 'add new record button' starts the process of adding a new record. When you click on this button you want to see what the next number will be that will be assigned to the next distributor that you will be adding.

Is you form bound or unbounded? Meaning, when you make a change to your data in the form is the change automatically reflected in the database, or do you need to click an "update" button for the changes to be reflected in the DB.

Reply With Quote
  #3  
Old November 26th, 2003, 01:56 PM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
As I experienced, the AutoNumber field shows the new record's number ONLY when the first key is pressed in the form or even a table. The new record is really added (to the memory buffer) when you press a key on your keyboard, and then, ONLY then, the next Auto Number displayed.
However, the record is flushed to disk only when you step away from the new record.
I think if your form and the controlds on your form is bound to the table properly, the 'Code' field on the form should display the new record's number.
Regards,
TBÁrpi

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > adding new records via forms....


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 5 hosted by Hostway