Author |
Topic  |
|
TerryG
Junior Member
 
United Kingdom
179 Posts |
Posted - 31 May 2001 : 11:32:02
|
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
|
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 |
 |
|
TerryG
Junior Member
 
United Kingdom
179 Posts |
Posted - 31 May 2001 : 12:53:40
|
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
|
 |
|
redbrad0
Advanced Member
    
USA
3725 Posts |
Posted - 31 May 2001 : 12:59:02
|
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 |
 |
|
TerryG
Junior Member
 
United Kingdom
179 Posts |
Posted - 31 May 2001 : 13:02:59
|
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.
|
 |
|
davemaxwell
Access 2000 Support Moderator
    
USA
3020 Posts |
Posted - 31 May 2001 : 13:16:08
|
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 |
 |
|
TerryG
Junior Member
 
United Kingdom
179 Posts |
Posted - 31 May 2001 : 13:18:23
|
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.
|
 |
|
|
Topic  |
|