firebirdta84
Technical User
Hey gang,
I need a little assistance. I have a database set up where an individual can go into a form, select the number of records they want assigned to them, and it will go into the table and place their name in the "AssignedTo" field for each record they request. The table is prioritized by the ID field, so if the user requests 5 records, it places their name in the first 5 records, ordered by the ID field. Here's the code I use for that:
DoCmd.RunSQL "Update (Select top " & Combo58 & " * From tbl_Master_BE where AssignedTo is null order by ID) dt Set AssignedTo ='" & Text60 & "'"
Combo58 is the number of records they want, Text60 is their name.
Here's my question - how do I alter this so when they select, say, 10 records, it doesn't assign the first 10, but assigns them every 3rd record until 10 have been assigned to them?
Thanks!
Joe
I need a little assistance. I have a database set up where an individual can go into a form, select the number of records they want assigned to them, and it will go into the table and place their name in the "AssignedTo" field for each record they request. The table is prioritized by the ID field, so if the user requests 5 records, it places their name in the first 5 records, ordered by the ID field. Here's the code I use for that:
DoCmd.RunSQL "Update (Select top " & Combo58 & " * From tbl_Master_BE where AssignedTo is null order by ID) dt Set AssignedTo ='" & Text60 & "'"
Combo58 is the number of records they want, Text60 is their name.
Here's my question - how do I alter this so when they select, say, 10 records, it doesn't assign the first 10, but assigns them every 3rd record until 10 have been assigned to them?
Thanks!
Joe