Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Operator's choice,to print or not to print control content

Status
Not open for further replies.

dunnjt

Technical User
Nov 20, 2001
64
US
A report called “Work Ticket” is based on a query which in turn is based on a table. There is a field in this report that displays the “Job Price”. This is the amount charged the customer. Everything is working just fine but I would like to print the Job Price on some, but not all of the Work Tickets.
Can anyone suggest a method so that I can easily elect “to print or not to print” the job price on the Work ticket at will?
I don’t write code but maybe someone could suggest a macro or some other way that would allow me the ability to decide to print or not to print. That is the question!
Thanks for any suggestions.
Jerry D.
 
You will need some sort of flag in your tickets table to indicate which tickets require the price printing. Make sure this field is included in your query and is available on your form so the operator can set it. Then on your report, modify the binding of the price textbox.

e.g.
Add a yes/no field 'PrintPrice' to your table.
Change your report 'Job Price' ControlSource to be =IIF([PrintPrice],[Job Price],"")

It would be an idea also to rename the textbox from the default 'Job Price' to something like 'txtJobPrice' to avoid confusion between the recordset field and the report textbox.

If this causes problems, then revert the textbox back to how it was, make it invisible (I usually colour invisible textboxes that horrible pink colour that nobody in their right mind would actually use), then add another textbox with the ControlSource as specified above. Reports are a bit funny like that sometimes. The new textbox will replace your normal 'Job Price' on the report - the original but now invisible textbox can be moved out of the way, but kept within the same report section.

The IIF function will examine the PrintPrice flag and display the [Job Price] value if the flag is set, or use an empty string if it is not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top