Numbers

Neo

Registered User.
Local time
Today, 13:48
Joined
Mar 5, 2003
Messages
42
I have a table which is used for access levels

there are two types

If the user is an operator they are Assigned a Number i.e. 1

If the user is a administrator the are assigned "Manager"

In a form that allows certain users to update this information

I have a combo box wher I can select if the user is Admin or Operator, if the user is an operator how do I get the DB to look at the last number and +1 to that

So if the last person to be added was number 10 and then a new opeator that was added would be number 11.

Thanks
 
What's your Admin table structure?

I'd suggest you change it to something like this:

tblUsers
UserID
UserForename
UserSurname
AccessLevelID
Other User Details

And an extra table, called:

tblAccessLevels
AccessLevelID
AccessDescription

Link the AccessLevelID primary key in the latter table to its foreign key in the former table.

This way, you are providing the option to add further access levels in the future (should the need arise).
 
The way I have it at the mo is

A manager who has access to all levels is assigned a "0"

Sales staff are assigned a number frm 1-what ever

the forms then use a Case Select method

Case 1
show only salesman 1 data

When I go to add new users. If the user is a manager then are assigned a 0

if they are sales they will have a number. I can add the number manually so if the last entry was 9 the new one would be 10. Once this is complete the DB will generate the queries needed.

I just wandered if there was a way to check the last number say 9 and the automatically put in a 10

The Access field type is number

Thanks for any help

p.s. I heard You knowledge on this forum is the best
 
Neo said:
p.s. I heard You knowledge on this forum is the best

That's rubbish! There are loads on the forum who know stuff I haven't even learnt yet (naming no names as there's just too many to list) :cool: .

Anyway, have a look at this, pick through it and see how it works.

* Had the Operator/Adminstrator logic the wrong way round - uploaded new version.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom