Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Displaying Records 1

Status
Not open for further replies.

CuckooNut

MIS
Oct 22, 2009
23
US
I know this is probably a really dumb question with a really easy answer, but I can't figure it out. I have a form that displays information about people in the database. The form has a subform that displays a person's test scores, date they took the test, etc.

The main form references the T_People table, and the subform references the T_Tests table. The main form and the subform are linked together on the person's ID. The main form has a combo box that allows you to select the person whose record you want to view. Everything works fine as long as the person you select has a corresponding record in the T_Tests table. However, if the person you select has never taken a test (and thus does not have a corresponding record in the T_Tests table), the form will not display that person's record. It just remains on whatever record it is currently displaying.

Any ideas as to why this is happening?
 
Can you provide the code for the combo box that moves to the selected record?
My first guess is that the main form is incorrectly joined to a query that joins the T_People to T_Tests. It only needs to be bound to T_People. If my assumption is correct then you will not have any records where the two tables do not link, thus your main form does not include any people without tests. So when you select a person from the combo there is no corresponding record in the main form.

Can you provide the recordsource for the main form?
 
Your assumption was correct. I just checked the recordsource for the main form, and it had a SELECT query that joined the two tables. I changed it so that the recordsource for the main form is just the T_People table, and now it works perfectly. Thank you for your quick response!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top