Task Query

but the problem I am facing is the result (record rows) generared by union query is being append to tbltaks with QryTaskAppend once i run it, firstly like 20 records appended to tbltask but listen carefully when I run second time without any changes it still append the same 20 records which is already exist in tbltask and it was appended by this query just a while ago

I do not have to listen carefully, because I absolutely expect it to do that. Would be shocked if it did not do it. You have done nothing to stop it from creating duplicates. If you make a composite index it cannot add duplicates. Or if you you check to see if a record already exists you could stop it from importing. I would do both.

I know this can be done by code but it could be a intense code writing which I don't know
Not really this can be done with SQL pretty easily. You can write an append query that only appends records that do not exist in the destination.

I think that's not possible, because when I use all tables PK as taskID in my tblTasks than it won't be unique anymore because all tables PK is having the number and autonumbers fields which will still be duplicates in TaskID

That may not be correct. In table Life Insurance, employee 1 has a record with say PK 123. No other employee has a PK of 123. If I make the PK
LifeInsurance123 in table task it is unique. In Table Passport there may be a PK of 123 but in Task it would be inserted as Passport123.

My question is when employee 1 gets a new life insurance do you update the information for that employee in life insurance or create a new record. If you update the Policy due date, I am uncertain how that creates a new or updated task.
 
The unmatched query that Isladog suggests would be a lot easier if we can come up with a natural key based on where the tasks come from.
Even if you cannot use
Category & Pk
You for Sure can make one from
Category & PK & DueDate

If not you will have to do an unmatched base on TaskDescription EmpID DueDate, because those are the three things making a task unique.
 
All I have done is changed DueDate to Yes (No Duplicates) and problem is solved.

Thanks everyone.


Now i need to place a list box or text box on form where loginID is equal to taskAssign field in tbltask, that means if any of these task assign to employee via tbltask AssignTo field who has access to update the record lets say "Employee" than what tasks assign to him should appear to that employee when he is login to database and he should be updating that task when its completed as tick beside task or type completed in taskstatus any arrangement.


TblTask all fields are

ID
EmpID
TaskDescription
TaskCatagory
DueDate
ReminderDate
TaskAssignDate
TaskAssignTo
TaskStatus
StatusDate




if AccessLevel is "Employee" then will go to frmEmployeeNavigation after login and assign task should appear to his navigation form.

if AccesLevel is "User" then will go to frmUserNavigation after login
if AccessLevel is "Admin" then will go to frmAdminNavigation after login
but in admin login i have another setups that i will be doing after completing the "Employee" task on his Navigation form by text box or list box whatever or any other idea you have to get it done easily.

thanks.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom