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

reports ans VBA

Status
Not open for further replies.

cumbrian

Programmer
Joined
Nov 27, 2001
Messages
2
Location
US
in a report I am trying to add up a number of yes/no fields from a single record on a form, and display the result in a text box on the report.
I am running my code from the on-open event of the report and using if statements to see if the yes/no fields are true! if they are I want to add then together. my if statements work and run ok, but when i try to insert the result into the text box I get an error.
the waty i am trying to insert the result in my text box is similar to: Me!txtboxname = 1 + 1 + 1.
but when i open the report I get an error with the message "you can't assign a value to this object". the problem seems to be something to do with the text box and the way i am trying to give some data - but how & why????
 
insert the result into a label: "label.caption = result" and it should work.

a.
 
Put a text box on your report with something like this as the control source:
Code:
=Abs([chkA]+[chkB]+[chkC]+[chkD])
this will add up the -1 and 0's and give you the absolute value....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top