[AccessD] Select case is too cumbersome

Hale, Jim Jim.Hale at FleetPride.com
Thu Jun 16 13:06:16 CDT 2005


I have a form which lists different Excel workbooks I can populate. When I
make a selection from the form I read the path to the appropriate excel
template  and the select case number from a table. I pass these to a
function  "Public Function Load_Financials(intCaseno As Integer, strpathname
As String)" for processing. The function opens the appropriate Excel
template and, based upon the select case number, populates the template from
various recordsets and formats the workbook as appropriate. All of this
works fine. My problem is that I am up to case 40 in my select statement.
Many of the cases are quite lengthy so Load_Financials is getting out of
hand. 5 cases was no big deal, 40 and 500 lines of code is a bit much.
Surely there is a more elegant way to arrange this. For example, I read "Two
functions you don't use enough" in this month's Smart Access which suggested
each case can be placed in its own function and the EVAL function can be
used to execute them. How do ya'll handle this issue?

Jim Hale

***********************************************************************
The information transmitted is intended solely for the individual or
entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of or taking action in reliance upon this information by
persons or entities other than the intended recipient is prohibited.
If you have received this email in error please contact the sender and
delete the material from any computer. As a recipient of this email,
you are responsible for screening its contents and the contents of any
attachments for the presence of viruses. No liability is accepted for
any damages caused by any virus transmitted by this email.


More information about the AccessD mailing list