I have a button with the following code
If Len(Me.Text25 & ""
Me.list1.RowSource = "SELECT * FROM [Annual Load Follow] WHERE [Annual Load Follow]![Counterparty] = '" & Me.Text25 & "'"
Me.list1.Requery
End If
If Len(Me.Contract_Number_ID & ""
Me.list1.RowSource = "SELECT * FROM [Annual Load Follow] WHERE [Annual Load Follow]![Contract Number ID] = '" & Me.Contract_Number_ID & "'"
Me.list1.Requery
End If
What this does is search the Annual Load Follow table and have it display every record that applies into a list box. Then in the list box we have the following code under double click
DoCmd.OpenForm "Annual Load Follow", , , "[Annual Load Follow]![Deal Ticket Number] = " & Me.list1
This opens the corresponding form that the user searched for.
Here are my problems,
Our table has 2 primary keys, a DEALTICKET NUMBER and a VERSION NUMBER each DEALTICKET NUMBER has multiple Version NUMBERS. When i click the search button it displays several of the same deal ticket number however, when you go to the list box no matter which of the deal ticket numbers you click it always shows the earliest Version Number. How would i fix this to show the latest?
Or else, in my list box, can i get my list box to show both primary keys? The DEAL TICKET NUMBER and the VERSION NUMBER???
Thanks in advance for any input.