[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

How to I put a Variable in a report Title

I have a Query that I have set a perimeter for where the user has to enter "Open" or "Closed" when prompt to run a report and I want to put put that into the title of the report..

I have put the following and it does not work"

="Tickets that are " & "   " & [RepairStatus]
0
TonyEF
Asked:
TonyEF
  • 7
  • 7
  • 2
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Try this:

="Tickets that are " & "   " & [Put Your Exact Prompt Text Here]

It should then display Open or Closed.

mx
0
 
dqmqCommented:
In the report header's format event:

me.TitleLabel.caption = me.RepairStatus          <--change to the name of your title control
0
 
TonyEFAuthor Commented:
I want the Query Parameter Value to display in the report header.. I try both of the suggestions and it does not work...

If I put that Parameter Value anywhere else in the report it does display the Value but not in the Report Title...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Please post the SQL for your query ...

mx
0
 
TonyEFAuthor Commented:
The query is working fine... here is the SQL:


SELECT TblMainInfo.AddressNo, TblMainInfo.Priority, TblMainInfo.LinearFootage, TblMainInfo.HandicapRamp, TblMainInfo.RepairType, TblMainInfo.NumberOfReports, TblMainInfo.RepairCompleted, IIf([RepairCompleted]=-1,"Open","Closed") AS Repair_Completed, TblMainInfo.StreetName
FROM TblMainInfo
WHERE (((IIf([RepairCompleted]=-1,"Open","Closed")) Like [Is Repair Competed? Enter Yes or No]));


0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Try this:


="Tickets that are " & "   " & [Is Repair Competed? Enter Yes or No]
0
 
TonyEFAuthor Commented:
Nope it does not work...
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
What do you get?

                                    ="Tickets that are " & "   " & [Is Repair Competed? Enter Yes or No]
This must be EXACTLY as the prompt in query ....  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

mx
0
 
dqmqCommented:
me.TitleLabel.caption ="Tickets that are " & "   " & me.Repair_Completed
      ----------------------   <--change TitleLabel to the name of control where you want the Title displayed

Also, look at this fragment.  How could it possibly work?  I mean you are comparing "Open"/"Closed" to "Yes"/"No?


WHERE (((IIf([RepairCompleted]=-1,"Open","Closed")) Like [Is Repair Competed? Enter Yes or No]));


0
 
TonyEFAuthor Commented:
see the screen capture attached..
Report-Header.jpg
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Put this

="Tickets that are " & "   " & [Is Repair Competed? Enter Yes or No]

as the Control Source of a Text box in the Report Header ...

see image below ...

mx
Capture1.gif
0
 
TonyEFAuthor Commented:
yep, it works that way...

thanks...
0
 
TonyEFAuthor Commented:
Thank you...
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
sorry for the confusion.
I thought it was in a text box ... but I noticed 'title' meaning Caption I suppose ...

mx
0
 
TonyEFAuthor Commented:
Yes, it was not a text box, that was the issue.. Typically access puts a label in the header..
I should have notice that as well..

Thanks for your assistance..
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
You are welcome ...

mx
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 7
  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now