smtazulislam
Member
- Local time
- Today, 17:10
- Joined
- Mar 27, 2020
- Messages
- 806
Hello Mr. Mike, Thank you so much.Hi
You are going about this in all the wrong way.
A Department has a number of Employees.
Instead of trying to copy Current Department and allocate a New Department.
You should have a table called tblDepartmentEmployees linked to tblDepartment as shown below:-
tblDepartment
-DepartmentID - PK - Autonumber
-Department
tblDepartmentEmployees
-DepartmentEmployeeID - PK - Autonumber
-DepartmentID - Number - FK -(Linked to tblDepartment PK)
-EmployeeID - Number - FK -(Linked to tblEmployee PK)
-DateFrom - Date/Time
-DateTo - Date/Time
Please check...OK Upload your new database
HiPlease check...
Its not same what the client needed.Hi
I created a Main Form based on the tblEmployee and then created a Subform based on the tblDepartmentEmployees.
It is recommended that when you store details of Employees Names then the name should be broken down into the smallest Entity.
I modified the Employee table so that you now enter data for EmployeeFirstname and EmployeeLastname.
This makes searching for a specific Employee is made that much easier by searching based on the EmployeeLastname.
See if this example makes it easier to understand.
Yes, Mr. Mike.Are you saying you are creating this database for a Client??
HiYes, Mr. Mike.
my manager want like that.
I want transaction history recored as like that:Hi
Please explain what exactly you need.
Normal layout is that an Employee belongs to a Department
Or
A Department has a Number of Employees
Which layout do you need?
DTID | EmployeeID | FromDate | PreviousDepartment | NewDepartment | ToDate |
---|---|---|---|---|---|
1 | 2 | 01/12/2020 | Finance | Maintenance | 15/12/2020 |
2 | 1 | 05/12/2020 | Finance | Projects | 18/12/2020 |
appreciated for your nice advice.Hi
The layout that you are requesting is wrong.
I have given you the recommended method of doing this.
If this does not suit then I am sorry this is as far as I can help.
Luck with your project.
DTID | EmployeeID | TransactionDate | NewDepartment | TransferDate | |
---|---|---|---|---|---|
1 | 2 | 01/12/2020 | Maintenance | 15/12/2020 | CmdUpdate table |
2 | 1 | 05/12/2020 | Projects | 18/12/2020 |
Please do it I need this one.Hi
It is possible to Update tblEmployee with a New Department using an Update but as I have pointed out this is the wrong way to record this information.
Thank you so much. I appreciated.Hi
See if this is what you need
Employee Table is updated. and go to first data record. Not stayed what Employee department I changed.Hi
I am not following
When you click Update Table the Employee Stays the same and the Department gets updated as you asked for