Public Function TreasuryNo(sNo As String) As String TreasuryNo = Format$(Now, "yyyyMMdd") If TreasuryNo <> Mid$(sNo, 3, 8) Then TreasuryNo = "sn" & TreasuryNo & "0001" Else TreasuryNo = "sn" & Right$(sNo, 12) + 1 End If
End Function
Private Sub Command1_Click() Text1.Text = TreasuryNo(Trim$(Text2.Text))
End Sub
Text2.Text值来源于 某个表 编号字段的最后一个数据