Values disappearing from Combo Box in Datasheet

music_al

Registered User.
Local time
Today, 14:17
Joined
Nov 23, 2007
Messages
200
I have 2 tables...

Department
Team

The team table has a field (foreign key) for the Department that the team is part of.

Department_ID
Department_Name

Team_ID
Team_Name
Department_ID (FK)

The department is entered via a Combo Box on the form. This works fine.

The Team is also entered via combo box. In the Row Source I have a query which uses the value in the Department combo box to query/filter the list of Teams.

I have a Split Form. The selected Department and Team are showing fine in the Single Form but the Team Combo Box is empty (even when a value has been selected) but it appears when that record is selected.

What am I doing wrong ?

Thank you in advance for your help.
 
Hi,

Are you saying you are using a lookup field at the table level?
 
its because your combo rowsource does not include the required values e.g.

tblDepartments
PK...Name
1.....DeptA
2.....DeptB


tblTeams
PK...DeptFK...TeamName
1.....1...………..TeamA
2.....1...………..TeamB
3...…2...………..TeamC
4...…2...………..TeamD

in a datasheet or continuous form, the rowsource applies to all rows

so if you are filtering your team combo for DeptB it will only display Teams C & D, so any rows with TeamA specified will not display anything

So you need some additional code - see this link for an example

https://www.access-programmers.co.uk/forums/showthread.php?t=275155
 

Users who are viewing this thread

Back
Top Bottom