BvCF
MIS
- Nov 11, 2006
- 92
The query that I will use to "auto assign" accounts to the staff (via Windows Scheduler) is below
UPDATE tblVar INNER JOIN tblAssignments ON tblVar.Contract=tblAssignments.Contract SET tblVar.AssignedTo =
tblAssignments.Employee_ID
WHERE tblVar.DateRecordCreated=Date() And tblVar.AssignedTo=Null;
As you can see, I am updating the "AssignedTo" field with the employee's id that is stored in
tblAssignments.
However, there are some contracts that may not be stored in tblAssignments.
For example, if an account on contract "XJJ" is not in tblAssignments but appended to my
main Access table (from Oracle), how can I auto assign all of the accounts on contract "XJJ"
to an administrator whose employee id is 3. Please note, by assigning this to the administrator,
the AssignedTo field is populated with "3", the administrator's employee id. Then, the
administrator will be the only individual to access this account within the Access database.
At that point, the Administrator can reassign the account to another employee.
My intial resolution is to incorporate an if statement within the Update query above.
How would you resolve this? Also, how would you display the username in the "AssignedTo" field
on the main form instead of the numerical "employee id" value that is stored in tblEmployees.
Any assistance would be greatly appreciated.
Thanks in advance.
For Reference, the following are the tables noted above
tblAssignments (Contract,Description,CustomerStaff,Employee_ID)
tblVar (Contract, AcctNo, AssignedTo, Username)
tblEmployees (Employee_ID, Username, Password, Access_Level)
UPDATE tblVar INNER JOIN tblAssignments ON tblVar.Contract=tblAssignments.Contract SET tblVar.AssignedTo =
tblAssignments.Employee_ID
WHERE tblVar.DateRecordCreated=Date() And tblVar.AssignedTo=Null;
As you can see, I am updating the "AssignedTo" field with the employee's id that is stored in
tblAssignments.
However, there are some contracts that may not be stored in tblAssignments.
For example, if an account on contract "XJJ" is not in tblAssignments but appended to my
main Access table (from Oracle), how can I auto assign all of the accounts on contract "XJJ"
to an administrator whose employee id is 3. Please note, by assigning this to the administrator,
the AssignedTo field is populated with "3", the administrator's employee id. Then, the
administrator will be the only individual to access this account within the Access database.
At that point, the Administrator can reassign the account to another employee.
My intial resolution is to incorporate an if statement within the Update query above.
How would you resolve this? Also, how would you display the username in the "AssignedTo" field
on the main form instead of the numerical "employee id" value that is stored in tblEmployees.
Any assistance would be greatly appreciated.
Thanks in advance.
For Reference, the following are the tables noted above
tblAssignments (Contract,Description,CustomerStaff,Employee_ID)
tblVar (Contract, AcctNo, AssignedTo, Username)
tblEmployees (Employee_ID, Username, Password, Access_Level)