I have a listbox which has 2 fields that are displayed based on a query. The query is based on a field called date. The other field is Date and is grouped by count.
The listbox displays the date correctly. I have the following event procedure for double click.
Private Sub List18_DblClick(Cancel As Integer)
Dim stDocName As String
Me.Visible = True
stDocName = "FAuctionInput"
DoCmd.OpenForm stDocName, acNormal, , "[Auction Date] = " &
[List18]
End Sub
So according to the code based on what I double clicked on the listbox it should open the form FauctionInput and display all records on the form that match.
I have tried bounding the listbox to 0 and 1 and it still didn't work. Also I don't get an error message either but it does open the form like its a new record. Before you ask the form doesnt open a form and automatically go to a new record and also Fauction input has [Auction Date] in there also. Any ideas how to resolve this would be greatly appreciated. I have been using this code for all sorts of databases and this is the first time it left me hanging. It may be that its not a primary key or I am missing something. Also willing to change the vba code if someone has another way of double clicking on a record in a listbox and returning the results for it. Side Note: if I go to the querry and enter [Enter date] it works as a perimeter query but I prefer to just double click on the listbox and displaying the form. Thanks