Private Function GetMaxId()
Dim ID As Integer
Dim BigCat As String
BigCat = Me.大类代码
ID = DMax("Right([分类代码],2)", "[商品分类]", "[大类代码]= '" & BigCat & "'")
If IsNull(ID) Then
GetMaxId = BigCat & "01"
Else
GetMaxId = BigCat & Format(CStr(CInt(ID)) + 1, "00")
End If
End Function