<PAGE>   1

                                                                   EXHIBIT 10.40


                      [UNION BANK OF CALIFORNIA LETTERHEAD]



                           AMENDMENT AND WAIVER LETTER



                                            Commercial Portfolio Administration

                                            Union Bank of California
                                            500 S. Main Street, Suite 200
                                            Orange, CA 92868



October 1, 1998


Mr. William Healey, President
Smartflex Systems, Inc.
14312 Franklin Avenue
Tustin, CA 92690-7028

Re:     FIRST AMENDMENT ("Amendment") to the Amended and Restated Loan Agreement
        dated September 26, 1997 (this Amendment and the Amended and Restated
        Loan Agreement together called the "Agreement")

Dear Mr. Healey:

In reference to the Agreement defined above between UNION BANK OF CALIFORNIA,
N.A. ("BANK") and SMARTFLEX SYSTEMS, INC. ("BORROWER"), Bank and Borrower desire
to amend the Agreement and waive certain breaches of the Agreement. Capitalized
terms used herein which are not otherwise defined shall have the meanings given
them in the Agreement.

        1.     Amendments to the Agreement:

               (a)    Section 1.1.1, line 5, is hereby amended by substituting
                      the date "October 2, 2000" for the date "September 30,
                      1999".

               (b)    Section 1.1.1.1, line 10, is hereby amended by
                      substituting the date "October 2, 2000" for the date
                      "September 30, 1999".

               (c)    Section 1.1.3, is hereby added in its entirety as follows:

                      "THE TERM LOAN I. Bank will loan to Borrower the sum of
                      THREE MILLION DOLLARS ($3,000,000) (the "Term Loan I") at
                      Borrower's request, in one disbursement on or before
                      December 31, 1998 in accordance with the terms of the Term
                      Note I. In the event of a prepayment of principal and
                      payment of any resulting fees, any prepaid amounts shall
                      be applied to the scheduled 

<PAGE>   2

Smartflex Systems, Inc.
1st Amendment to Amended and Restated Loan Agreement
October 1, 1998
Page 2

                      principal payments in the reverse order of their maturity.
                      The Term Loan I shall be evidenced by a promissory note
                      (the "Term Note I") on the standard form used by Bank for
                      commercial loans."

               (d)    Section 1.3, is hereby amended by adding the following
                      language:

                      "The proceeds of the Term Loan I shall be used to purchase
                      real property."

               (e)    Section 1.4, is hereby amended in its entirety to read as
                      follows:

                      "INTEREST. The unpaid principal balance of the Loans shall
                      bear interest at the rate or rates provided in the Notes.
                      The Loans may be prepaid in full or in part only in
                      accordance with the terms of the Notes and any such
                      prepayment shall be subject to the prepayment fee provided
                      for therein."

               (f)    Section 1.5, line 3, is hereby amended by substituting the
                      date "October 2, 2000" for the date "September 30, 1999".

               (g)    Section 1.5.2, is hereby added in its entirety to read as
                      follows:

                      "TERM LOAN I COMMITMENT FEE. A NON-REFUNDABLE one eighth
                      of one percent (1/8%) fee shall be paid upon the funding
                      on the amount of the Term Loan I.

               (h)    Section 4.5(b), line 2, is hereby amended by deleting the
                      words "and consolidating".

               (i)    Section 4.6, is hereby amended in its entirety to read as
                      follows:

                      "TANGIBLE NET WORTH. From December 31, 1997, Borrower will
                      at all times maintain Tangible Net Worth of not less than
                      FORTY SEVEN MILLION DOLLARS ($47,000,000). Thereafter,
                      Borrower will at all times maintain a minimum Tangible Net
                      Worth that increases from said amount as of the end of
                      each Borrower's fiscal years by seventy-five percent (75%)
                      of Borrower's net profit after taxes plus one hundred
                      percent (100%) of any new equity capital additions.
                      "Tangible Net Worth" shall mean net worth increased by
                      indebtedness of Borrower subordinated to Bank and
                      decreased by patents, licenses, trademarks, trade names,
                      goodwill and other similar intangible assets,
                      organizational expenses, and monies due from affiliates
                      (including officers, shareholders and directors)."

        2.     Waivers to the Agreement:

               (a)    Bank hereby provides a waiver of Borrower's breach of
                      Section 5.3, of the Agreement.

<PAGE>   3

Smartflex Systems, Inc.
1st Amendment to Amended and Restated Loan Agreement
October 1, 1998
Page 3

                      "SALE OF ASSETS, LIQUIDATION OR MERGER. Borrower will
                      neither liquidate nor dissolve nor enter into any
                      consolidation, merger, partnership or other combination,
                      nor convey, nor sell, nor lease all or the greater part of
                      its assets or business, nor purchase or lease all or the
                      greater part of the assets or business of another."

               (b)    Bank hereby provides a waiver of Borrower's breach of
                      Section 5.5, of the Agreement.

                      "INVESTMENT. Borrower will not purchase the debt or equity
                      of another person or entity except for savings accounts
                      and certificate of deposit of Bank, direct U.S. Government
                      obligations and commercial paper issued by corporations
                      with the top ratings of Moody's or Standard & Poor's,
                      provided all such permitted investments shall mature
                      within two years of purchase."

Except as specifically amended hereby, the Agreement shall remain in full force
and effect and is hereby ratified and confirmed. This First Amendment and Waiver
shall not be a waiver of any existing or future default or breach of a condition
or covenant unless specified herein.

This First Amendment shall become effective when Bank shall have received the
acknowledgment copy of this First Amendment and Waiver executed by Borrower.

Very truly yours,

UNION BANK OF CALIFORNIA, N.A.


By:     //s// Robert Thomas
        --------------------------------
        Robert Thomas
Title:  Vice President


By:     //s// Jim Heim
        --------------------------------
        Jim Heim
Title:  Vice President


AGREED AND ACCEPTED TO THIS 13TH DAY OF OCTOBER, 1998.

SMARTFLEX SYSTEMS, INC.


By:     //s//  William Healey
        --------------------------------
        William Healey
Title:  President