Simplest way to search in a form

saskurja7

New member
Local time
Today, 07:15
Joined
Jun 26, 2013
Messages
3
I am attempting to create a search form where a user can search by either employee name or company name. I have 5 tables to use. Is there a simple way of creating a search method for this? I would like to be able to have the user type in a name and click a button that says search with any records matching the search come up. However, I could definitely use a method where they type it in a box and it finds it as the person types.

Please make sure if you answer this that you let me know how to search from all five tables at the same time.

Thank you very much. I am so closed to finishing this project and any help would be greatly appreciated.
 
Hello saskurja7, Welcome to AWF.. :)

In a RDB world.. The data should not be scattered across several (normally).. However you have them in 5 different tables.. So, I think your tables are not Normalized.. This I understand from your description.. If I am wrong please let do say so..

Having said that, could you show the relationships between the tables? And some sample data?
 
I currently have no relationships.
Sample Data:

My tables hold records of orientation dates. The first table, contractors, would hole the company name, employee name, date of orientation, due date, ...

I already have the program ready to go to add, but I need to search.

For instance, I need to be able to let a user go in and search for a certain company to see what employees are under that company. I only have one employee record per company, but multiple records with the same company. I would be satisfied if I am able to search but still have to keep the tables separated and have different searches. I just need to know the beginning steps of creating a search.
 
Its really hard to give a simple work around.. (Although several exists, it will come with a great cost, and I do not have time).. The solution/suggestion I would give is to redesign the table structures.. You have put forward only two tables in front of me.. So based on that.. Your tables should be something along the lines of..

tblCompany
compID - PK
compName
compLocation
'and all other related fields

tblEmployee
empID - PK
cID - FK
empName
'and all other related fields

This way, your tables will have a One - Many relationship.. i.e. One company can have several employees.. This way Searching/Adding/Editing records for one company employees is a matter of simple SELECT queries.. Think about it..
 

Users who are viewing this thread

Back
Top Bottom