Results 1 to 9 of 9
  1. #1
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76

    List Box - On dbl Click - Opens record - Asks for paramater?

    Hello,




    I have a list box that is tied to a Query "SearchDBQ" and when a user types in a field and clicks search the items populate in the list box. I want it so the user can double click on the item in the listbox and go to that record. Only problem is when I double click on it a box appears that says "
    Please enter a paramter" and the message is "ReportList" which is the name of my list box.


    Any help?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Hard to say without seeing the code, but generally the parameter prompt means Access can't find something.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Private Sub Search_Fields_Click()
    RequeryReportList
    End Sub
    Private Sub RequeryReportList()
    Dim Wh As String
    Dim SQL As String
    Wh = ""
    If First_Name <> "" Then
    If Wh <> "" Then Wh = Wh & " " & AndOrCombo & " "
    Wh = "First_Name LIKE '*" & First_Name & "*'"
    End If
    If Last_Name <> "" Then
    If Wh <> "" Then Wh = Wh & " " & AndOrCombo & " "
    Wh = "Last_Name LIKE '*" & Last_Name & "*'"
    End If
    If Date_Report_Submitted <> "" Then
    If Wh <> "" Then Wh = Wh & " " & AndOrCombo & " "
    Wh = "Date_Report_Submitted LIKE '*" & Date_Report_Submitted & "*'"
    End If
    If Report_Title <> "" Then
    If Wh <> "" Then Wh = Wh & " " & AndOrCombo & " "
    Wh = "Report_Title LIKE '*" & Report_Title & "*'"
    End If
    If Report_History_Type <> "" Then
    If Wh <> "" Then Wh = Wh & " " & AndOrCombo & " "
    Wh = "Report_History_Type LIKE '*" & Report_History_Type & "*'"
    End If
    If Approved <> "" Then
    If Wh <> "" Then Wh = Wh & " " & AndOrCombo & " "
    Wh = "Approved LIKE '*" & Approved & "*'"
    End If
    If Department_Number <> "" Then
    If Wh <> "" Then Wh = Wh & " " & AndOrCombo & " "
    Wh = "Department_Number LIKE '*" & Department_Number & "*'"
    End If
    If Abstract <> "" Then
    If Wh <> "" Then Wh = Wh & " " & AndOrCombo & " "
    Wh = "Abstract LIKE '*" & Abstract & "*'"
    End If
    Me.RecordSource = SQL
    SQL = "SELECT [SearchDBQ].[Department_Number], [SearchDBQ].[First_Name], [SearchDBQ].[Last_Name], [SearchDBQ].[Date_Report_Submitted], [SearchDBQ].[Report_Title], [SearchDBQ].[Report_History_Type], [SearchDBQ].[Approved] FROM SearchDBQ WHERE " & Wh
    ReportList.RowSource = SQL
    ReportList.RowSource = SQL
    End Sub
    Private Sub Clear_Fields_Click()
    First_Name = ""
    Last_Name = ""
    Date_Report_Submitted = ""
    Report_Title = ""
    Report_History_Type = ""
    Approved = ""
    Department_Number = ""
    Abstract = ""
    ReportList.RowSource = ""
    End Sub
    Private Sub ReportList_DblClick(Cancel As Integer)
    If IsNull(ReportList) Then Exit Sub
    DoCmd.OpenForm "NewLabReportF", , , "Report_ID= ReportList"
    End Sub



    Click image for larger version. 

Name:	Search.png 
Views:	17 
Size:	51.3 KB 
ID:	16482

  4. #4
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    It's looking for REPORTLIST either in the query, or somewhere, and it doesnt exist.

    The query is looking in a table, but there is no field called this,
    or no text box on the form.
    To get form values, you must have the entire path to the form: forms!frmMain!REPORTLIST.


    Its missing somewhere.
    Last edited by ranman256; 05-16-2014 at 12:25 PM. Reason: spellg

  5. #5
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Reportlist is the list box name... how should I enter in the changes and where should I make them

  6. #6
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    When I hit cancle on the screen it shows this error:



    Private Sub ReportList_DblClick(Cancel As Integer)
    If IsNull(ReportList) Then Exit Sub
    DoCmd.OpenForm "NewLabReportF", , , "Report_ID= ReportList"
    End Sub

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Parker View Post
    Private Sub ReportList_DblClick(Cancel As Integer)
    That is very different than the code you posted earlier. Perhaps you can concatenate the Where criteria with the variable that is the list box control.

  8. #8
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    wait....your code is wrong...
    Code:
     "Report_ID=" &  ReportList
    Last edited by ranman256; 05-16-2014 at 01:20 PM. Reason: correction

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    regarding:

    DoCmd.OpenForm "NewLabReportF", , , "Report_ID= ReportList"

    see the syntax here:

    BaldyWeb wherecondition
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to add List of Names by One Click
    By bronson_mech in forum Forms
    Replies: 6
    Last Post: 05-31-2014, 11:13 AM
  2. Replies: 2
    Last Post: 03-13-2013, 06:13 PM
  3. Replies: 3
    Last Post: 10-04-2012, 01:33 PM
  4. List Box Click Event
    By bginhb in forum Forms
    Replies: 3
    Last Post: 04-09-2012, 02:06 PM
  5. Replies: 3
    Last Post: 10-13-2011, 01:51 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums