|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Help with a Query
Please could someone help with the following problem...
Here are the tables relevent to my question: tblProjects *ProjectID ProjectTitle StartDate EndDate tblEmployees *EmployeeID LastName FirstName Etc... tblAssignation *AssignationID ProjectID EmployeeID AssignedHours When the user is entering data into the assignation table, i want them to be able to use a combo box to view the EmployeeID field, only i don't want them to see the EmployeeID, i want them to see the corresponding LastName. And in reverse, when they select the LastName i want the corresponding EmployeeID to be entered into the record. Any ideas would be much appreciated. Thanks in anticipation. |
|
#2
|
|||
|
|||
|
What type of form is this? HTML, MS Access, Visual Basic, .Net? If it is HTML you can set the value equal to the employeeID. If it is one of the others you will need to perform a query to resolve the name to the id. You will need to handle duplicate names though.
__________________
El éxito consiste en una serie de pequeñas victorias día a día MySQL, MS SQL, MS ACCESS, Oracle Database Manager - http://victorpendleton.net/products/psdviewer.html |
|
#3
|
|||
|
|||
|
In MS Access format.
I want to create the query in the lookup tab of the table's design view. |
|
#4
|
|||
|
|||
|
How will you handle the possibilty of two Joe Users?
When a user highlights a name and submits the form you could: Run a query to resolve the employeeID select employeeID from employees where name = [passed_value] Then create your insert statement Insert into assignment values(employeeID, assignment) |
|
#5
|
|||
|
|||
|
Victor,
Thanks very much for taking the time to think about my question and post you replies. I've managed to solve the problem, taking on board your suggestions for multiple entries of the same name. Thanks again. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Help with a Query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|