Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Searching out a problem (Access03)

    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

  2. #2
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Searching out a problem (Access03)

    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

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Searching out a problem (Access03)

    At the end of the For ... Next loop, strWhere2 will look like
    <code>
    , "This", "That", "Other"
    </code>
    The final condition should look like
    <code>
    Credential In("This", "That", "Other")
    </code>
    So you have to get rid of the initial "<code>, </code>" (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?

  4. #4
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Searching out a problem (Access03)

    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!
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Searching out a problem (Access03)

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

  6. #6
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Searching out a problem (Access03)

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •