how to do this,? help me plz

deepbreath

Registered User.
Local time
Today, 12:34
Joined
Apr 18, 2001
Messages
73
i have list of contacts containing their job description as well. many people have same jobs. how can i find people according to their job. i.e many can be doctors. so i want to make a search form, in which a list box displays all the jobs and when you select any job like doctor, it displays all the people who are doctor in second box. and on clicking on the name it takes you to their record. can you give me a example . urgently needed.
will greatly appreciate.
 
Sigh - tis will take longer to explain than to do.

An approach:

Define a table "tblSpecialties" containing a row for each job, say "Gastroenterology", "Internal Medicine", "Psychiatry", etc.

The field containing the job/specialty will be the record source for a combo box called cboSpecialty on the form.

Define a lookup query that will look something like "SELECT* FROM tblEveryone WHERE JobDescription LIKE *" & Forms!frmMyForm!cboSpecialties & "*;". Use this query as the RecordSource for a subform on the form containing cboSpecialty. The subform should contain a field for the person's name and a field for the description.

Use the AfterUpdate event for cboSpecialty to Requery the Subform. Then, whenever the user selects a new specialty, the subform will be updated to display only persons with that specialty name/term in their Description field.

If someone clicks on the person's name on the subform, you can use the OnClick event to open a form (or a constructed Msgbox, if the amount of information is reasonably small and it's read-only) to display all the information about the person.
 
i really appreciate, but may be i am too junior for this, could you plz help in detail steps. i tried but it did not worked for me.
thanx once again
 
I'll see if I can gin something up and email it to you. Is your email correct on this site?
 
oh great, thanx a lot jim, i really appreciate this. i also send you a email before i got your email,
 
yeeeeeh it worked great for me. thanks, it really saved me a lot of trouble. now can you put a check box on the subform in front of each record so that you can print a report from the selected records by pressing a command button.
 

Users who are viewing this thread

Back
Top Bottom