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!

auto incrementing numbers with validation 1

Status
Not open for further replies.

djnick

Technical User
May 7, 2001
5
GB
Hello...

I can just about use access to create a database and some simple forms.. so please make sure all answers are nice and clear. thank you..

the problem I have got, is a simple one. I using access as a members database each member should have a unique number.

I want advice / help / code on the following :

I want to be able to go to the membersid field and type in a number.

after I have entered that number I would like to see if it allready exists and warns / shows the details of that user in some form.

if not after completing the record and a new record is being to created to take the number of the last member and add 1 to this.

is this possible ?
is this possible for me to do ? (lol)

please as much info as poss. dont assume anything.. also any good book on starting to write proper database where it looks more like a program than access would also be gratelly recieved.
 
look at the "AutoNumber" data type in Ms. Access.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
.
Michael is right about the autonumber data type...it's the place to start.

Sometimes, there is a need to avoid gaps in the number id sequence, and you could enter the following in the property sheet for your form:

In form design view, double click the pertinent control, which will display the property sheet. Click on the tab "Data", and enter the following in the row "Default Value:"
Code:
=DMax("[membersID]","tblMembers")+1
The default value will increment by 1 for each new record.

But if you don't mind letting Access assign the numbers for you, use the Autonumber. When you open your table in design view you can explore the different data types. Everywhere you have a question, press F1 and see how much help you will get from the built in help messages.

Good luck.
:) Gus Brunston
An old PICKer
padregus@home.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top