Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Is this a sensible solution ???
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 31 May 2001 :  11:32:02  Show Profile
Would anyone like to venture an opinion on whether I am going about this in the right way?
I am creating an ASP app for use on an Intranet.
Users will fill out some data on an HTML form, which is then saved to an Access DB. In order to save thier data to the DB only one item (out of 150) on the form is mandatory. Users are expected to come back to the form from time to time and add more data as they find it.
Then, when they have 'enough' data they submit the form to thier boss for authorisation. At this point, depending on which department within the company they work for the form/data must recieve a unique sequential number, ie
if Company A take next number in the sequence 1000-1999
if Company B take next number in the sequence 2000-2999
if Company C take next number in the sequence 3000-3999
if Company D take next number in the sequence 4000-4999
etc etc

The only way I can see that Access can do this numbering for me is to save the records to a 'Temp' table untill the user wants authorisation,and then save it to either 'Company A Table' or 'Company B Table' etc depending on options the user has set on the form, with the unique number being set by an auto number field in the table.

Is this a sensible solution or is their an easier/better way??


redbrad0
Advanced Member

USA
3725 Posts

Posted - 31 May 2001 :  12:50:34  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
from what you said i would believe that this would work. but i thinik you could just have a table called authorisation and have a column for each company (or department) name

Brad
Go to Top of Page

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 31 May 2001 :  12:53:40  Show Profile
How would each company in that table get its unique/sequential number, ie
next record for Company A needs to take the next number in the sequence 1000-1999
next record for Company B needs to take next number in the sequence 2000-2999



Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 31 May 2001 :  12:59:02  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
well before i answer how you could do that (wouldnt be the best way, but would work), whats going to happen when company A gets to 1999? then they would be going into company b's id numbers

Brad
Go to Top of Page

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 31 May 2001 :  13:02:59  Show Profile
Yeah I asked the same question myself when they gave me the project. no answer was forthcomming however i expect the truth is they will change the whole numbering system thereby providing me with a whole load of work redoing this bit of the code! Short answer is we don't need to worry about it right now.

Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 31 May 2001 :  13:16:08  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
Sounds like something you SHOULD worry about now. If it's going to cause you a lot of re-work in the future and you can prevent it, then fight for it. A better suggestion for them would be to create a unique identifier for each company, then the users wouldn't have to look at the sequence to figure out which they need....

However, if they don't go for that, then you can do this:
SELECT MAX(seq_no) FROM TableA WHERE seq_no BETWEEN 1000 AND 2000

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page

TerryG
Junior Member

United Kingdom
179 Posts

Posted - 31 May 2001 :  13:18:23  Show Profile
Thats great, many thanks for your help. I may need to ask more dumb questions when I get to this bit of code early next week, but for now many thanks for your help.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07