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

Allocate records by predefined number

Status
Not open for further replies.

scottian

Programmer
Jul 3, 2003
955
GB
i have a table which contains loads of jobs that need to be allocated to staff. Ive set it up to pick the top 5 and update with staff id etc.
However my manager now wants to be able to select a certain number, for example 21 and allocat that amount. Anyone have any ideas how i do this?

"My God! It's full of stars...
 
How did you set it up to pick the top 5? Did you use a query for that? If so, you can run the SQL through code, and wherever it says "TOP 5" in the SQL, replace it with whatever they input (on a form).

strSQL = "SELECT TOP 5..."

replace with

strSQL = "SELECT TOP " & txtNumberToRetrieve.Value
 
Im confused. I allways thought you could only use sql with action queries.

where do i put this strSQL

"My God! It's full of stars...
 
I need a little more detail on how you perform the allocation of jobs in your application. Queries, Forms, Reports, etc.
 
The manager selects a user Login Idea from a combo box and the type of job from a combo box (both unbound) then on a button click an update query is run which updates the records in a top five select query which queries the manin. Now, if the main table contains lets say 36 records the manager wants to allocate them equally between 3 users (12 each). So by using my top 5 query the best the manger could do would be one user being allocated 10 records another being allocated 15 records and the last being allocated the remaining 11.

i appreciate your time with this




"My God! It's full of stars...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top