Cannot open form by double clicking list box

foxtet

Registered User.
Local time
Today, 05:50
Joined
May 21, 2011
Messages
129
When double click the entries given in the attached database I cannot open the correct form. it gives parameter value.

kindly help me to overcome this error.

Fox
 

Attachments

Show us the code in the Double Click event of the List box that attempts to open the form.
 
Private Sub SearchResults_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frm_File_Info"

stLinkCriteria = "[FileNumber]=" & Me![SearchResults]

DoCmd.OpenForm "frm_File_Info", acNormal, , "FileNumber=" & Me.SearchResults.Column(1)


End Sub
 
Might be some problem with the Listbox properties. What is the Listbox RowSource, Bound Column, Column Count, Column Widths?

What is the type of the FileNumber field? Text or Number?
 
Private Sub SearchResults_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frm_File_Info"

stLinkCriteria = "[FileNumber]=" & Me![SearchResults]

DoCmd.OpenForm "frm_File_Info", acNormal, , "FileNumber=" & Me.SearchResults.Column(1)


End Sub
Replace the line with the below.
DoCmd.OpenForm "frm_File_Info", acNormal, , "FileNumber='" & Me.SearchResults.Column(0) & "'"
 

Users who are viewing this thread

Back
Top Bottom