PDA

Click to See Complete Forum and Search --> : Functions and sql questions


Nauj
Jan 18th, 2000, 02:49 AM
I have two questions. The first is about functions.

1. Functions
Wich is the best place for a function a form or a module(bas)?.
I'm interested in memory and speed of my functions.
Which are the main differences between both places?.

2. Crystal Report
I'm using Crystal Report 7.0 and I want to know if it's
possible to make a field in my report that contains a query.
I want to make a "select sum" in one table and I want a field
to show the result of that query. Is it possible?.
I'm trying using a "sql expresion field" but I don't have success. Any advive???.

Thank you very much

Nauj

Aaron Young
Jan 18th, 2000, 03:09 AM
1. Where you put a Function depends on the Scope you want it to have, ie.
If you Declare a Private Function within a Form, it's only accessible to the Code within the Form.
Declaring a Public Function within a Form is only Accessable whilst the Form is Loaded and via that Form, ie.

Form1.PublicFunctionName()

Placing a Private Function in a Module is only Accessible to that Module, a Public Function is Accessible to all the Components of the Application without a Direct Reference to the Module.

2. Select Insert Formula Field And click New, Enter a Name for the Field and you'll be taken to the Formula Editor, where you can build the Formula you wish to Report on.

------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
ajyoung@pressenter.com