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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Registration System

Status
Not open for further replies.

RKN

Technical User
Feb 15, 2001
2
CA
My database is a registration system for free tours but with limited seats available. On the registration form, I have a textbox field that a Tour Code (unique) is enter by the user. The Tour Code is something like C0615-1 (text type). Once the user enters in all of the personal information that is necessary to register, he/she will hit the Submit button. When the Submit button is clicked, I would like the VisitorID (unique)textbox field to automatically display the Tour Code plus increment by 1 (number). I have to increment by 1 to keep track of the number of visitors. How do I get the VisitorID to display automatically?


This database is going to be intranet/internet enabled using Frontpage as an interface. Will this affect the database in any way? I would appreciate any help/suggestions.
 
I don't think it will affect anything.
But you need to have a table with one field to hold this number to increment. So you would open the table get the number, then add one to it, and put that new number back in the table for the next time.

here is some code I have had for a while to do just that
---------------------
'open table and get the last RA number used
Dim MyDB As Database, MySet As Recordset
Set MyDB = currentdb
Set MySet = MyDB.OpenRecordset("Last-RA-Number")
MySet.MoveFirst
MySet.Edit
Temp1 = MySet.Fields("Last_RA_Number")
Temp2 = Temp1 + 1
MySet.Fields("Last_RA_Number") = Temp2
MySet.Update
MySet.Close
MyDB.Close
----------------------------
then you would add Temp1 to your UniqueID like so

MyID = "C0615-" & ltrim(str(Temp1))




DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top