<PAGE>

                                                                   Exhibit 10.40


                       FIRST AMENDMENT TO CREDIT AGREEMENT

THIS FIRST AMENDMENT TO CREDIT AGREEMENT, dated as of June 28, 2002 (this
"Amendment"), is among KEY COMPONENTS, LLC (the "Borrower"), the Lenders (as
defined below) signatories hereto and WACHOVIA BANK, NATIONAL ASSOCIATION
(formerly known as First Union National Bank), as administrative agent for the
Lenders (in such capacity, the "Administrative Agent").

                              W I T N E S S E T H:

WHEREAS, the Borrower, certain Subsidiaries (such capitalized term and other
capitalized terms used in these recitals to have the meanings set forth or
defined by reference in Part I below) and other equity holders, as Guarantors,
certain financial institutions and other Persons from time to time parties
thereto (collectively, the "Lenders"), the Administrative Agent, Societe
Generale, as the Syndication Agent, The Bank of New York , as the Documentation
Agent, and Wachovia Securities and SG Cowen Securities Corporation, as
Co-Arrangers, are parties to the Credit Agreement, dated as of September 29,
2000 (the "Existing Credit Agreement");

WHEREAS, the Borrower has requested that the Lenders amend the Existing Credit
Agreement as set forth below; and

WHEREAS, the Lenders have agreed, subject to the terms and conditions
hereinafter set forth, to amend the Existing Credit Agreement in certain
respects (the Existing Credit Agreement, as so amended or otherwise modified by
this Amendment, being referred to as the "Credit Agreement");

NOW, THEREFORE, in consideration of the premises and for other good and valuable
consideration (the receipt and sufficiency of which is hereby acknowledged), the
parties hereto hereby agree as follows:

                                   DEFINITIONS

Certain Definitions. The following terms (whether or not underscored) when used
in this Amendment shall have the following meanings (such meanings to be equally
applicable to the singular and plural forms thereof):

"Administrative Agent" is defined in the preamble.

"Amendment" is defined in the preamble.

"Borrower" is defined in the preamble.

"Credit Agreement" is defined in the third recital.

"Existing Credit Agreement" is defined in the first recital.

"First Amendment Effective Date" is defined in Subpart 3.1.

"Lenders" is defined in the first recital.

Other Definitions. Terms for which meanings are provided in the Existing Credit
Agreement are, unless otherwise defined herein or the context otherwise
requires, used in this Amendment with such meanings.


                                   AMENDMENTS

Effective on (and subject to the occurrence of) the First Amendment Effective
Date, the Existing Credit Agreement is hereby amended in accordance with this
Part; except as so amended or otherwise modified by this Amendment, the Existing
Credit Agreement and the Loan Documents shall continue in full force and effect
in accordance with their terms.

Amendment to Article I. Article I of the Existing Credit Agreement is hereby
amended in accordance with Subparts 2.1.1 through 2.1.4.

         Section 1.1 of the Existing Credit Agreement is hereby amended by
inserting the following definitions therein in the appropriate alphabetical
order:

                  "First Amendment" means the First Amendment, dated as of June
         28, 2002, to this Agreement among the Borrower, the Administrative
         Agent and the Lenders parties thereto.

                  "First Amendment Effective Date" is defined in Subpart 3.1 of
         the First Amendment.

<PAGE>

         Section 1.1 of the Existing Credit Agreement is hereby further amended
by amending and restating the grid table included in the definition of
"Applicable Margin" to read in its entirety as follows:

<TABLE>
<CAPTION>
                                               Applicable Margin
                  Funded Debt to                      For            Applicable Margin For    Applicable Margin For
                   EBITDA Ratio                Base Rate Loans          LIBO Rate Loans          Commitment Fees
                   ------------                ---------------          ---------------          ---------------
<S>                                            <C>                   <C>                      <C>
                 Less than 3.50:1                    1.00%                   2.25%                   0.375%
          Greater than or equal to 3.50:1            1.75%                   3.00%                   0.375%
               and less than 4.00:1
          Greater than or equal to 4.00:1            2.00%                   3.25%                   0.500%
               and less than 4.25:1
          Greater than or equal to 4:25:1            2.25%                   3.50%                   0.500%
</TABLE>

         Section 1.1 of the Existing Credit Agreement is hereby further amended
by amending the definition of "EBITDA" appearing therein by (a) deleting the
punctuation mark "." appearing at the end of clause (f) thereof and inserting
the punctuation mark ";" in replacement therefor and (b) inserting the following
immediately after clause (f) thereof:

         "plus

                           (g) non-recurring restructuring charges for such
                  Rolling Period incurred in connection with the consolidation
                  of Acme's warehousing located in Lumberton, North Carolina on
                  terms agreed to by the Administrative Agent (in its reasonable
                  discretion) (provided that the aggregate amount of such charge
                  shall not exceed $100,000);

         plus

                           (h) non-cash pension expenses for such Rolling
                  Period;

         plus

                           (i) non-cash impairment charges for such Rolling
                  Period in connection with the Borrower's implementation of
                  Financial Accounting Standards Board Statement of Financial
                  Standards No. 142, "Goodwill and Other Intangible Assets", in
                  accordance with GAAP; provided, that such charges shall not
                  exceed (i) $2,000,000 in any Fiscal Year occurring during the
                  period from and including Fiscal Year 2003 through the
                  Termination Date or (ii) $5,000,000 in the aggregate for the
                  Fiscal Years occurring during the period from and including
                  Fiscal Year 2003 through the Termination Date;

         plus

                           (j) non-recurring charges for such Rolling Period in
                  respect of previously capitalized bank fees written off as a
                  result of the First Amendment, in an aggregate amount not to
                  exceed $150,000."

         SUBPART 2.1.4. Section 1.1 of the Existing Credit Agreement is hereby
further amended by amending the definition of "Permitted Acquisition" appearing
therein by (a) inserting the following immediately after clause(b) thereof:

                  "(c) with respect to any such Permitted Acquisition made on or
         before December 31, 2003, the aggregate consideration paid or to be
         paid by the Obligors with respect to such Permitted Acquisition shall
         not exceed the sum of the following:

                  (i) $7,5000,000, plus

                  (ii) the aggregate amount of Net Equity Proceeds received by
         the Obligors (other than any Compliance Capital, and other than any Net
         Equity Proceeds used to finance a redemption or repayment of Senior
         Notes pursuant to Section 7.2.6(b)(z)), plus

                  (iii) the aggregate amount of Net Disposition Proceeds and Net
         Debt Proceeds received by the Obligors (other than any Net Disposition
         Proceeds or Net Debt Proceeds used to acquire assets other than in
         connection with a Permitted Acquisition, and other than any Net
         Disposition Proceeds used to finance a redemption or repayment of
         Senior Notes pursuant to Section 7.2.6(b)(z)), plus

                  (iv) the aggregate amount of Indebtedness assumed in
         connection with all such Permitted Acquisitions (so long as such
         Indebtedness is permitted to be incurred under Section 7.2.2(d) or
         Section 7.2.2(i));"; and

         (b) relettering clauses (c) through (e) thereof as clauses (d) through
(f), respectively.


<PAGE>

         Amendment to Article VII. Article VII of the Existing Credit Agreement
         is hereby amended in accordance with Subparts 2.2.1 through 2.2.6.

                  Clause (d) of Section 7.2.2 of the Existing Credit Agreement
         is hereby amended by deleting the reference to "$15,000,000" appearing
         therein and inserting a reference to "$5,000,000" in replacement
         therefor.

                  Clause (i) of Section 7.2.2 of the Existing Credit Agreement
         is hereby amended by deleting the reference to "$10,000,000" appearing
         therein and inserting a reference to "$5,000,000" in replacement
         therefor.

                  Clause (a) of Section 7.2.4 of the Existing Credit Agreement
         is hereby amended and restated to read in its entirety as follows:

                           "(a) the Interest Coverage Ratio, as of the last day
                  of each Fiscal Quarter falling in the periods set forth below,
                  to be less than the ratio set forth opposite such period:


                      Fiscal Quarters ending                  Minimum Interest
                     in the following periods                  Coverage Ratio
                     ------------------------                  --------------
               June 30, 2002 through March 30, 2003              2.50 to 1
               March 31, 2003 through June 29, 2003              2.75 to 1
              June 30, 2003 through December 30, 2003            3.00 to 1
             December 31, 2003 through March 30, 2004            3.25 to 1
                   March 31, 2004 and thereafter                 4.00 to 1"


                  Clause (b) of Section 7.2.4 of the Existing Credit Agreement
         is hereby amended and restated to read in its entirety as follows:

                           "(b) the Fixed Charge Coverage Ratio, as of the last
                  day of each Fiscal Quarter falling in the periods set forth
                  below, to be less than the ratio set forth opposite such
                  period:


                   Fiscal Quarters ending               Minimum Fixed Charge
                  in the following periods                 Coverage Ratio
                  ------------------------                 --------------
            June 30, 2002 through March 30, 2004              1.00 to 1
               March 31, 2004 and thereafter                 1.10 to 1"

                  Clause (c) of Section 7.2.4 of the Existing Credit Agreement
         is hereby amended and restated to read in its entirety as follows:

                           "(c) the Funded Debt to EBITDA Ratio, as of the last
                  day of each Fiscal Quarter falling in the periods set forth
                  below, to be greater than the ratio set forth opposite such
                  period:


                   Fiscal Quarters ending                 Maximum Funded Debt to
                  in the following periods                     EBITDA Ratio
                  ------------------------                     ------------
            June 30, 2002 through March 30, 2003                 4.50 to 1
            March 31, 2003 through June 29, 2003                 4.25 to 1
          June 30, 2003 through September 29, 2003               4.00 to 1
         September 30, 2003 through March 30, 2004               3.75 to 1
               March 31, 2004 and thereafter                    2.75 to 1"

Section 7.2.7 of the Existing Credit Agreement is hereby amended and restated to
read in its entirety as follows:

         "SECTION 7.2.7. Capital Expenditures, etc. The Borrower will not, and
will not permit any of its Subsidiaries to, make or commit to make, without
duplication, Capital Expenditures in any Fiscal Year in excess of the sum of the
following:

                  (a)(i) during any Fiscal Year occurring prior to Fiscal Year
                  2002 which aggregate an amount in excess of $7,500,000, (ii)
                  during Fiscal Year 2002 which aggregate an amount in excess of
                  $5,000,000, (iii) during Fiscal Year 2003 which aggregate an
                  amount in excess of $6,000,000 and (iv) in any Fiscal Year
                  subsequent to Fiscal Year 2003 which aggregate an amount in
                  excess of $7,500,000 for any such Fiscal Year;

         plus

                  (b) any amount permitted to be expended in respect of Capital
                  Expenditures in the immediately preceding Fiscal Year pursuant
                  to clause (a) above but not so expended; provided, however,
                  that any unused amount of Capital Expenditures during Fiscal
                  Year 2001 may not be carried forward to any subsequent
                  period."


<PAGE>


                           CONDITIONS TO EFFECTIVENESS

Effectiveness. This Amendment and the amendments contained herein shall become
effective on the date (the "First Amendment Effective Date") when each of the
conditions set forth in this Part shall have been fulfilled to the satisfaction
of the Administrative Agent.

         Execution of Counterparts. The Administrative Agent shall have received
            counterparts of this Amendment, duly executed and delivered on
            behalf of each Borrower, the Administrative Agent and the Required
            Lenders.

         Amendment Fee. The Administrative Agent shall have received, for the
            account of each Lender which shall have executed this Amendment
            concurrently with or prior to the effectiveness hereof, an amendment
            fee in an aggregate amount equal to .25% of the aggregate amount of
            each such Lender's Percentage of the Total Exposure Amount (after
            giving effect to this Amendment and the reduction specified in
            Subpart 3.1.3. below).

         Reduction in Commitment Amount. The Administrative Agent shall have
            received a duly executed irrevocable written notice from the
            Borrower pursuant to Section 2.3 of the Credit Agreement reducing
            the unused amount of the Revolving Loan Commitment Amount by
            $15,000,000.

         Affirmation and Consent. The Administrative Agent shall have received,
            with counterparts for each Lender, an Affirmation and Consent to
            this Amendment substantially in the form of Exhibit A hereto, duly
            executed and delivered by each of the Obligors other than the
            Borrower.

         Resolutions. The Administrative Agent shall have received resolutions
            of the Board of Directors of the Borrower duly ratifying the
            execution, delivery and performance of this Amendment, duly
            certified by an Authorized Officer as being in full force and effect
            without amendment or modification, all in form and substance
            reasonably satisfactory to the Administrative Agent.

         Opinion of Counsel. The Administrative Agent shall have received an
            opinion, dated the date of this Amendment and addressed to the
            Administrative Agent and all Lenders, from Sonnenschein Nath &
            Rosenthal, counsel to the Obligors, in form and substance
            satisfactory to the Administrative Agent.

         Legal Details, etc. All documents executed or submitted pursuant hereto
            shall be satisfactory in form and substance to the Administrative
            Agent and its counsel. The Administrative Agent and its counsel
            shall have received all information and such counterpart originals
            or such certified or other copies or such materials as the
            Administrative Agent or its counsel may reasonably request, and all
            legal matters incident to the transactions contemplated by this
            Amendment shall be satisfactory to the Administrative Agent and its
            counsel.

                  MISCELLANEOUS; REPRESENTATIONS AND COVENANTS

Continuing Effectiveness, etc. As amended hereby, the Credit Agreement shall
remain in full force and effect and is hereby ratified and confirmed in all
respects. After the First Amendment Effective Date, all references in the Credit
Agreement and each other Loan Document to the "Agreement" or "Credit Agreement",
as applicable, shall refer to the Existing Credit Agreement, after giving effect
to this Amendment, and this Amendment shall be a Loan Document for all purposes.
The Borrower hereby confirms its obligations under Section 11.3 of the Credit
Agreement to pay all fees and expenses of the Administrative Agent (including
reasonable fees and out-of-pocket expenses of counsel) in connection with this
Amendment and other ongoing administration of the Credit Agreement as provided
in Section 11.3 of the Credit Agreement since the last invoice it received.

Counterparts. This Amendment may be executed in any number of counterparts and
by the different parties on separate counterparts, and each such counterpart
shall be deemed to be an original but all such counterparts shall together
constitute one and the same Amendment.

Governing Law. THIS AMENDMENT SHALL BE A CONTRACT MADE UNDER AND GOVERNED BY THE
INTERNAL LAWS OF THE STATE OF NEW YORK.

Successors and Assigns. This Amendment shall be binding upon the Borrower, the
Lenders and the Agents and their respective successors and assigns, and shall
inure to their successors and assigns.

<PAGE>


Representations and Warranties. In order to induce the Lenders to execute and
deliver this Amendment, the Borrower represents and warrants to the Agents, the
Lenders and the Issuer that, after giving effect to the terms of this Amendment,
the following statements are true and correct: (a) the representations and
warranties set forth in Article VI of the Existing Credit Agreement and in the
other Loan Documents are true and correct on the First Amendment Effective Date
as if made on the First Amendment Effective Date and after giving effect to the
First Amendment (unless stated to relate solely to an earlier date, in which
case such representations and warranties were true and correct in all material
respects as of such earlier date); and (b) no Default has occurred and is
continuing.

                  [REMAINDER OF PAGE INTENTIONALLY LEFT BLANK.]


IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be executed
and delivered by their respective authorized officers as of the day and year
first above written.


                                              KEY COMPONENTS, LLC


                                              By:
                                                     ---------------------------
                                              Title:


LENDERS:


                                              WACHOVIA BANK, NATIONAL
                                              ASSOCIATION,
                                                as Administrative Agent and as
                                                a Lender


                                              By:
                                                     ---------------------------
                                              Title:


                                              SOCIETE GENERALE,
                                               as Syndication Agent and as a
                                               Lender


                                              By:
                                                     ---------------------------
                                              Title:

<PAGE>


                                              THE BANK OF NOVA SCOTIA


                                              By:
                                                     ---------------------------
                                              Title:


                                              CITIBANK, N.A.

                                              By:
                                                     ---------------------------
                                              Title:


                                              PROVIDENT BANK OF CINCINNATI


                                              By:
                                                     ---------------------------
                                              Title:


                                              THE BANK OF NEW YORK


                                              By:
                                              Title:



<PAGE>


                                              CITIZENS BANK OF MASSACHUSETTS


                                              By:
                                                     ---------------------------
                                              Title:


                                              FLEET CAPITAL CORPORATION


                                              By:
                                                     ---------------------------
                                              Title:

                                              EAST WEST BANK


                                              By:
                                                     ---------------------------
                                              Title:


                                              CERES II FINANCE LTD.
                                              By:


                                              INVESCO Senior Secured
                                                Management, Inc.
                                                as Portfolio Advisor


                                              By:
                                                     ---------------------------
                                              Title:


                                              CHARTER VIEW PORTFOLIO
                                              By:  INVESCO Senior Secured
                                                   Management, Inc.
                                                   as Portfolio Advisor

                                              By:
                                                     ---------------------------
                                              Title:


                                              LAGUNA FUNDING TRUST

                                              By:
                                                     ---------------------------
                                              Title:

<PAGE>


                             AFFIRMATION AND CONSENT

                                                                   June 28, 2002


The Lenders (as defined below) and
Wachovia Bank, National Association,
  as Administrative Agent
One Wachovia Center
301 South College Street
Charlotte, NC  28288


                               KEY COMPONENTS, LLC


Gentlemen and Ladies:

Reference is made to the First Amendment (the "Amendment"), dated as of June 28,
2002, to the Credit Agreement, dated as of September 29, 2000 (the "Existing
Credit Agreement"; the Existing Credit Agreement, as amended, supplemented,
amended and restated or otherwise modified by the Amendment, the "Credit
Agreement"), among Key Components, LLC, certain Subsidiaries and other equity
holders, as Guarantors, certain financial institutions and other Persons from
time to time parties thereto (collectively, the "Lenders"), Wachovia Bank,
National Association (formerly known as First Union National Bank), as the
Administrative Agent, Societe Generale, as the Syndication Agent, The Bank of
New York , as the Documentation Agent, and Wachovia Securities and SG Cowen
Securities Corporation, as Co-Arrangers. Unless otherwise defined herein or the
context otherwise requires, terms used herein have the meanings provided in the
Credit Agreement.

By their signature below, the undersigned Obligors hereby acknowledge and
consent to the amendment of the Existing Credit Agreement and the terms and
provisions thereof as set forth in the Amendment. Each undersigned Obligor
hereby reaffirms the covenants and agreements contained in each Loan Document to
which it is a party, including as such covenants and agreements may be modified
by the Amendment, this Affirmation and Consent and the transactions contemplated
thereby. Each undersigned Obligor hereby further certifies that, as of the date
hereof (both before and after giving effect to the effectiveness of the
Amendment), the representations and warranties contained in the Loan Documents
to which such Obligor is a party are true and correct with the same effect as if
made on the date hereof, except to the extent such representations or warranties
expressly relate to a date prior to the date hereof (in which case such
representations and warranties were true and correct as of such earlier date).
Each undersigned Obligor further confirms that each Loan Document to which it is
a party is and shall continue to be in full force and effect and the same are
hereby ratified and confirmed in all respects, except that upon the
effectiveness of the Amendment, all references in such Loan Documents to the
"Agreement" or "Credit Agreement"; if applicable, shall mean the Credit
Agreement as in effect and as modified by the Amendment.


<PAGE>



IN WITNESS WHEREOF, the undersigned has caused this Affirmation and Consent to
be executed and delivered by its officer hereunto duly authorized as of the date
first above written.



                                            B.W. ELLIOTT MANUFACTURING CO., LLC
                                            HUDSON LOCK, LLC
                                            ESP LOCK PRODUCTS, LLC
                                            GITS MANUFACTURING COMPANY, LLC
                                            ATLANTIC GUEST, INC.
                                            MARINE INDUSTRIES COMPANY, LLC
                                            TURNER ELECTRIC, LLC
                                            KEY COMPONENTS, INC.
                                            ACME ELECTRIC CORPORATION


                                            By
                                               ---------------------------------
                                               Name:
                                               Title:



                                            GUEST BUILDING, L.L.C.,
                                              by ATLANTIC GUEST, INC., its
                                              sole member


                                            By
                                               ---------------------------------
                                               Name:
                                               Title: