|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 ![]() |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
||||
|
||||
|
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 |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > adding new records via forms.... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|