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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textbox giving error: #Error on simple forumula 1

Status
Not open for further replies.

47redlands

Programmer
Mar 9, 2010
62
GB
I have a report which will print a ticket.
On this report I have a textbox which is unbound.
in the textbox if I type price it gives the ticket price of £12.00. The report data is being derived from qryTicketDetails

However I want to calculate a discount if the ticket is brought by recommennded friend.This is the formula I have devised:

=IIf([Friend]=True,[price]*0.9, [price])

but it returns with error
#Error
#
please help thank you
 
Did you make sure the name of the text box is not the name of a field in the report's record source?

Is Friend as yes/no field? Is the Price column left or right aligned when the record source is viewed in datasheet view? If so, you have some how created Price as a text field, not numeric. Perhaps you have applied some formatting or use Nz() or IIf().

Duane
Hook'D on Access
MS Access MVP
 
Thank you Dhookom

It is not working because IS friend is yes/no field .. thank you.
 
Thank you for help Dhookom. In reply to your question I have formated the textfeild so it currency and I will be checking for null values.
 
dhookom,

The project I am working on after a serious of tests worked as I wanted. That it calculated the ticket price. Thank you for your help so far.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top