• Searching out a problem (Access03)

    Author
    Topic
    #430767

    I have a report created and is activated by a button. The form limited to material selected on the form that the button resides on. One of the selections is credentials. Everything appears to be setup correctly except I am getting a parameter query box for edential. Which you will notice is part of credential. I have done a fine for the word as a whole word and as a pattern. It doesn’t find the whole word in the module or procedure and it always finds a otherwise properly spelled word when pattern is run. I have also looked back at the base query with no look.

    Any bright ideas?

    Thank you. Fay

    Viewing 1 reply thread
    Author
    Replies
    • #1006777

      Okay here is the code that is the problem, I think.

      For Each varItm In [Forms]![frmTasks]![lstCredentials].ItemsSelected
      strWhere2 = strWhere2 & “, ” & Chr(34) & Forms!frmTasks!lstCredentials.ItemData(varItm) & Chr(34)
      Next varItm
      strWhere2 = “Credential In (” & Mid(strWhere2, 3) & “)”

      I think the problem is with the bottom strWhere2 line. Any help would be appreciated. I have adjusted the 3 both ways and the issue doesn’t resolve. I guess what I am actually saying is that I don’t understand the function of that last line.

      Thank you. Fay

      • #1006783

        At the end of the For … Next loop, strWhere2 will look like

        , "This", "That", "Other"

        The final condition should look like

        Credential In("This", "That", "Other")

        So you have to get rid of the initial “, ” (without the quotes). That’s what Mid(strWhere2, 3) does.
        Do you have another instruction further on that uses Mid(strWhere2, 3) or something similar?

        • #1006918

          I just went back and read what you wrote before. I found the problem I had added a strWhere3 for a third list box. I copied and pasted the code for the strWhere2 and made most of the changes. I failed to change what is now the second strWhere3 from strWhere2. As always you came through and I appreciate it. Thank you.

          strWhere3 = “Status In (” & Mid(strWhere3, 3) & “)”

          Fay

    • #1006827

      Just a shot ‘from left field’.
      One place that odd parameters can ‘hide’ in reports is in the sorting and grouping dialog. Another is conditional formatting.

      Happy hunting!

      • #1006915

        Thanks Steve neither of those was the problem. Drats. Thanks for trying. Fay

    Viewing 1 reply thread
    Reply To: Searching out a problem (Access03)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: