Virginia National Bank Shares Inc., the state's second-largest bank holding company, today reported record first-quarter earnings, but bank executives cautioned against excessive optimism about the rest of the year.

Virginia National Chairman C. A. Cutchins said the bank will face increasing competition partly because federal banking deregulation gradually will eliminate interest-rate ceilings, broaden customer service authority for thrift institutions and permit the offering of interest-bearing checking accounts nationwide.

"A rapidly changing banking environment has presented us with a series of new challenges requiring new perspectives on the way we conduct the business of banking," Cutchins said during the bank's annual stockholders meeting here today. "These changes are the result of many factors: inflation, erratic money markets and changing government regulations, to list just a few. However, an additional factor has become increasingly apparent to the banking industry. This factor is competition."

The new deregulation law will "improve the opportunity for banks and thrifts to develop and maintain deposits by permitting more equitable competition for deposits at money market rates," Cutchins said. "At the same time, the cost of funds will increase."

Bank President John B. Bernhardt said the bank's first-quarter earnings were good, but he added, "I would caution, however, that we do not believe the first-quarter's momentum can be sustained thoroughout the year at its current high level."

For the first quarter ended March 31, income before securities transactions was $7.2 million ($1.01 a share) compared with $6.1 million (88 cents). Net interest income was $32.1 million, an 8.9 percent increase from $29.5 million a year earlier. Total assets on March 31 were $2.7 billion compared with $2.5 billion. Deposits were $2.2 billion compared with $2.1 billion.

"It was an excellent beginning for 1981, with the first-quarter's results establishing a . . . quarterly earnings record," Cutchins said. "The increase in earnings primarily reflected an increase in net interest income, as the combined effect of higher interest yields on an increased volume of earnings assets more than offset the rise in interest expense."