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

Query report 1

Status
Not open for further replies.

sepia

Programmer
May 18, 2001
26
US
I have a report that get it's data from a query and I want to add another text box to it. The text in the new text box
will be based upon boolean fields from the above mentioned query. What would be the most effective and easiest
way to accomplish this? Thru VBA code, expression or a macro?
 
"Thru VBA code, expression or a macro?"

"macro" == BAD.

Use Code or the query.

If the expr based on BooleanS are fairly simple, create a field in the query to generate the text/strign directly. as in:

MyText: IIF([blnA] And [blnB], "First", IIF([BlnB], "Second", "None"))

Note: above is probably NOT exactly correct. Only shown 'for effect'. If the expr is more compklex than this, use a Function - but you can Still put it in the query, like:

MyText: MyFunct([blnA], [blnB], [blnC])

MyFunct would accept the three boolean arguments and return a string:

Public MyFunct (A as Boolean, B as Boolean, C as Boolean) as String

[tab]'figure out what to say

[tab]MyFunct = "xxx" 'bur really the results from "figure out '''"

End Function


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top