Results 1 to 5 of 5
  1. #1
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318

    InStr Parameter in Report Title

    I have two fields in my SQL query Quarter and MyParameter: InStr([Enter Quarter separated by commas: 1,2,3,4],[Quarter])



    For MyParameter let's say for example I enter 1,2,3

    I want the report title to read Summary Report for Quarter(s) 1,2,3

    I tired ="Summary Report for Quarter(s) " & [Quarter] in the report but it only returns Summary Report for Quarter(s) 1

    How can I get the parameter entry to show in the report title?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    InStr returns the position of the found string, not the string. So if [Quarter] = 2 then the position in 1,2,3 = 3, not 2. Why do you need Instr?

    ="Summary Report for Quarter(s) " & [Enter Quarter separated by commas]

    However, parameter prompts are annoying, I don't use them. Have user enter value in textbox on form and refer to textbox:

    ="Summary Report for Quarter(s) " & Forms!formname!textboxname
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318
    I need the parameter for the query. I tried using the Forms!formname!textboxname in the Quarter field in the query but it doesn't work with the commas. How can I do a list box in the form where they can click on multiple quarters and have it work with the query and the report title?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    What do you mean 'doesn't work with the commas'? User types in the desired string: '1,2,3' or '2,3,4' or '3,4,1' or whatever. The commas are just text.

    How does this pertain to query? You want the input to be criteria for filtering records? As well as use in the report title?

    Using a multi-select listbox will be complicated. Review: http://allenbrowne.com/ser-50.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318
    Decided to go a different way. Thank you

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

Similar Threads

  1. Dynamic Chart Title in Report
    By Kirsti in forum Reports
    Replies: 10
    Last Post: 03-21-2012, 01:56 PM
  2. Replies: 1
    Last Post: 01-22-2012, 02:41 PM
  3. Replies: 1
    Last Post: 11-21-2011, 03:22 PM
  4. Variable Report Title in Access 2010
    By Titan078 in forum Reports
    Replies: 4
    Last Post: 11-17-2010, 11:22 AM
  5. Replies: 20
    Last Post: 05-24-2010, 06:31 AM

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