E
excel-chump
I have a three combo boxes. Two run as a cascade: "Advocate" selection
limits "Reviewer" selection in subform. What I am trying to accomplish
within the third combo box is a "reverse" lookup: By selecting a "Reviewer"
it will pull up the "Advocate" main form. I got this working, however, when
it pulls up the "Advocate" main form it pulls only the first "Reviewer"
listed under the advocate rather than the selected name.
Where: ODIS ID = Advocate ID, User ID = Reviewer
Here is the SQL query, "reverselookup", I'm using:
SELECT [FR Data].[First Name]+' '+[FR Data].[Last Name] AS Expr1, [FRA
Data].[ODIS ID], [FR Data].[User ID]
FROM [FRA Data] INNER JOIN [FR Data] ON [FRA Data].[ODIS ID]=[FR Data].[FRA
ID]
ORDER BY [FR Data].[First Name]+' '+[FR Data].[Last Name];
-------------------------------
I'm forced to set the ODIS ID as the bound column to update the main form
and I don't know how to write the code to force the selection in the reverse
lookup combo box rather than the first Reviewer with the listed Advocate.
-------------------------------
'This is the code I'm using to show the record on the form:
Private Sub reverselookup_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ODIS ID] = '" & Me![reverselookup] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
limits "Reviewer" selection in subform. What I am trying to accomplish
within the third combo box is a "reverse" lookup: By selecting a "Reviewer"
it will pull up the "Advocate" main form. I got this working, however, when
it pulls up the "Advocate" main form it pulls only the first "Reviewer"
listed under the advocate rather than the selected name.
Where: ODIS ID = Advocate ID, User ID = Reviewer
Here is the SQL query, "reverselookup", I'm using:
SELECT [FR Data].[First Name]+' '+[FR Data].[Last Name] AS Expr1, [FRA
Data].[ODIS ID], [FR Data].[User ID]
FROM [FRA Data] INNER JOIN [FR Data] ON [FRA Data].[ODIS ID]=[FR Data].[FRA
ID]
ORDER BY [FR Data].[First Name]+' '+[FR Data].[Last Name];
-------------------------------
I'm forced to set the ODIS ID as the bound column to update the main form
and I don't know how to write the code to force the selection in the reverse
lookup combo box rather than the first Reviewer with the listed Advocate.
-------------------------------
'This is the code I'm using to show the record on the form:
Private Sub reverselookup_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ODIS ID] = '" & Me![reverselookup] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub