Combo box based on subform entries

Numpty

on t'internet
Local time
Today, 08:59
Joined
Apr 11, 2003
Messages
60
I have a form called Settings which is based on a table also called Settings. Within the form there is a subform of people [Delegates] who are employed at that Setting. The subform is based on a table SettingDelegateLink.
On the main form I have various fields relating to certain key positions within the setting - i.e. Manager/Head and Foundation Stage Contact.
What I would like to be able to do is allow the user to choose from a combo box who these positions are held by. The valid options would be those employed at that setting (those within the subform). I cannot just base it on the SettingDelegateLink table as that would show people employed at other settings so I need to be able to filter it to only show those related by SettingID.

Unfortunatly I can't figure this one. Does anyone know how to go about this and where to enter the code?
 
Numpty said:
I have a form called Settings which is based on a table also called Settings. Within the form there is a subform of people [Delegates] who are employed at that Setting. The subform is based on a table SettingDelegateLink.
On the main form I have various fields relating to certain key positions within the setting - i.e. Manager/Head and Foundation Stage Contact.
What I would like to be able to do is allow the user to choose from a combo box who these positions are held by. The valid options would be those employed at that setting (those within the subform). I cannot just base it on the SettingDelegateLink table as that would show people employed at other settings so I need to be able to filter it to only show those related by SettingID.

Unfortunatly I can't figure this one. Does anyone know how to go about this and where to enter the code?

Lets pretend that your combobox has name cboSettingID which
contains obviously your SettingID field value.

Private Sub cboSettingID_AfterUpdate()

Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[SettingID] = " & Str(Me![cboSettingID])
Me.Bookmark = rs.Bookmark
End Sub
 

Users who are viewing this thread

Back
Top Bottom