Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Des Autonumber Increment and Boundaries

Status
Not open for further replies.

Hinfer

Programmer
Sep 14, 2001
69
CA
I have created a form for filling in client information. The primary key is client id and is set to autonumber.

The problem:

If a user decides to partially fill out the form (client id = 1) but then decides not to and exits the form the next time a user fills out the form the client id is 2. THat means that the client id 1 is "wasted". Is there a way to get around this? Can I use something else other than auto number? I think I now what to code but where and how do I get to the place to code it?

My second question is:

How do I specify the autonumber to boundaries. What number to start AND END??

( This autonumber feature is quite finicky!!!)

Thanks
 
Why dont you just implement an 'On Exit' function, or something along them lines which prompts the user with a msgbox telling them that they cannot leave the relevant fields blank etc etc.

- F8i
Programmer
e: f8i@f8i.co.uk
 
On another note, you are probably best off just allowing the form to 'Show' records with no ability to 'Add Additions'.

Then place a button on the form, an 'Add' button, which opens a new form, of which you fill in the data and on selecting 'OK' etc etc it adds it to the database, but if they only fill in partial stuff get it to present an prompt and NOT add it to the database until all info is complete. Also on clicking cancel it will just close the screen and no data gets added either.

If you need more help with the actual sctructure of it I would be more then happy to help

Hope that helps!

- F8i
Programmer
e: f8i@f8i.co.uk
 

I think Jozshi got the point, in fact I solve this in using unbound controls on the form.
If the user clicks ok (rsp. save), I check if all the controls are filled, and if , I insert a new record into my database's table.
this gives also the possibility to inform the user if his data was not added etc.

regards Astrid
 
Exactly what I meant..except Sawatzky put it better in much less words. :D

- F8i
Programmer
e: f8i@f8i.co.uk
 
Jozshi & Sawatzky:

Yep I have done that already but even if the form closes and does not save any data, the counter (autonumber) gets incremented the next time I come back in. I don't think that its a big deal but just something I was worried about if users "play around" with forms (half way through filling the form the user decides that the person should not be in the client database for some reson).

Thanks
 
Dear Hinfer,

What happens, if you just open the form , than close it again, without doing anything else?
Does this increment the autonummber too?

Is the Form itself bound to the underlying table? (that shouldn't)


Best regards

Astrid



 
Hinfer,

See the FAQs in the general Access discussion. Loads on autonumber.

Craig
 
Sawatzky:

No open and close the form does not increment the autonumber. The form is bound to the Client table.
 
Dear Hinfer

I would unbind the form AND have the controls unbound too, and then do it as I described before.


regards Astrid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top