Procedure too large? What does this mean?

tjewers

Registered User.
Local time
Today, 15:40
Joined
Sep 19, 2000
Messages
11
Hi,

I am getting the "Procedure too large" error in a search form that I am creating. I know this is because my procedure is way to big. I was wondering if anyone can give me hints on how to break up the code, but still use it in the command button.

Basically the code is a number of if else statements. Is there some way to put each if else statement in a procedure and use them in the procedure for the command button?

Any and all help is appreciated.

Tracy
 
At time if and if else logic becomes too large and complex there are two choices I have found work.

The first is the call statement

if x<10 then
Call Exact(x as double)
elseif x>10 and x<20
Call notExact(x as double)
and so on

This works well for other values, where two or more values require comparison. In the called procedure simply write the code.

The other code that will substantially reduce the lenght of if ... then, elseif statements is

Select Case
Case to 12
Code to suit
Case is 13 to 20
Code to suit
and so on
 

Users who are viewing this thread

Back
Top Bottom