G
Guest
I have two combo boxes. Search by & Search For. Select something in Search
by like "company name", it then puts all the records in Search by so you can
select one (ie ABC Flowers). But if I have two records, different company
names, but same merchant's names, they own two stores, it wont show both
records when I select merchants name - since that will be the same. What can
I do to fix this?
CODE:
Search by:
Private Sub SearchBy_AfterUpdate()
Me.SearchFor.RowSourceType = "Table/Query"
Me.SearchFor.RowSource = "SELECT DISTINCT [" & _
Me.SearchBy & "] FROM [" & _
Me.SearchBy.RowSource & _
"] ORDER BY [" & Me.SearchBy & "]"
End Sub
Search for:
Private Sub SearchFor_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[" & Me.[SearchBy] & "] = " & Chr(34) & Me![SearchFor] & Chr(34)
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.SearchFor = Null
End Sub
Thanks
Curtis
by like "company name", it then puts all the records in Search by so you can
select one (ie ABC Flowers). But if I have two records, different company
names, but same merchant's names, they own two stores, it wont show both
records when I select merchants name - since that will be the same. What can
I do to fix this?
CODE:
Search by:
Private Sub SearchBy_AfterUpdate()
Me.SearchFor.RowSourceType = "Table/Query"
Me.SearchFor.RowSource = "SELECT DISTINCT [" & _
Me.SearchBy & "] FROM [" & _
Me.SearchBy.RowSource & _
"] ORDER BY [" & Me.SearchBy & "]"
End Sub
Search for:
Private Sub SearchFor_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[" & Me.[SearchBy] & "] = " & Chr(34) & Me![SearchFor] & Chr(34)
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.SearchFor = Null
End Sub
Thanks
Curtis