Click here to Skip to main content
15,896,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have two tables.

Faculty_Code Text (Table Name Faculty_Details)

Records in the Faculty_Details as follows;

Faculty_Code

GS
MK
CK
NR


Another Table (Table Name Schedule_Details)

Faculty_Code

GS
Mk
SJ
PN

then in the run mode in the combo box all the Faculty_Code from Faculty_Details( table) will display in the combo box.

in combo box Faculty_Code as follows from the table Faculty_Details.

GS
MK
CK
NR

Then i have one button called View.

when user select Faculty_Code GS (the Gs Faculty_Code is there in the both the table) from the combo box and click the view button.

i want to show the message the select faculty is there.please select different faculty.

how to write the query to compare two tables and similar columns in MS Access Database.
Posted
Comments
Wasim1989 31-Jan-13 9:17am    
you can select count(*) as count from Schedule_Details where Faculty_Code = 'your faculty_Code(combobox value)';
then check count if count greaterthen 0 it means FacultyCode exists and show your message.
Hemant Singh Rautela 31-Jan-13 9:26am    
not getting well,

show your code which you tried...

1 solution

try this.
SQL
select count(*) as count from Schedule_Details where Faculty_Code = 'your faculty_Code(combobox value)

then check count value. if count greater-then 0 it means FacultyCode exists and show your message.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900