Using a junction table to populate synchronized Combo boxes? (1 Viewer)

acce55user

New member
Local time
Today, 20:55
Joined
Sep 26, 2018
Messages
2
Hi,

I have 2 Combo boxes that I want to synchronize using data from 3 tables:

Table 1: tblLocation
LocationID, LocationName

Table 2: tblPlatform
PlatformID, PlatformName

Table 3: tblPlatformDetails
LocationID, PlatformID

Table 3 is the Junction Table to create a many to many relationship.


I managed to get the two combo boxes to synchronize using the following query:



SELECT tblPlatformDetails.PlatformID
FROM tblLocation INNER JOIN tblPlatformDetails ON tblLocation.LocationID = tblPlatformDetails.LocationID
WHERE (((tblLocation.LocationID)=[Forms]![frmLogEntry].[cboLocation]));




The problem is the second combo box is auto-populated with PlatformID after Location is selected but I would like it to be populated with PlatformName instead.

I am a newbie and struggling to figure out how to do this. Any help would be most appreciated.:banghead:

Thanks in advance
 

June7

AWF VIP
Local time
Today, 12:55
Joined
Mar 9, 2014
Messages
5,423
You should save the PlatformID but display the PlatformName. Include PlatformName in the SELECT as the second field. Set combobox properties:

ColumnCount: 2
ColumnWidths: 0";1"
 

acce55user

New member
Local time
Today, 20:55
Joined
Sep 26, 2018
Messages
2
You should save the PlatformID but display the PlatformName. Include PlatformName in the SELECT as the second field. Set combobox properties:

ColumnCount: 2
ColumnWidths: 0";1"




Hi,


I don't have Access at home so can't try this until Friday when back to work. But, just to be clear, is this what you mean?


SELECT tblPlatformDetails.PlatformID, tblPlatform.PlatformName
FROM tblLocation INNER JOIN tblPlatformDetails ON tblLocation.LocationID = tblPlatformDetails.LocationID
WHERE (((tblLocation.LocationID)=[Forms]![frmLogEntry].[cboLocation]));




Thanks for your reply.
 

Users who are viewing this thread

Top Bottom