Dim max As String
Dim idx As Integer
max = DataTables("项目合伙人明细表").Compute("Max(项目编号)")
If max > "" Then
idx = CInt(max.Substring(4,3)) + 1
Else
idx = 1
End If
Dim hhrcount As Integer = e.Form.Controls("TextBox1").value
Dim count As Integer = Tables("项目合伙人明细表").rows.count
Tables("项目合伙人明细表").AddNew(hhrcount)
For i As Integer = count To count+hhrcount-1
Tables("项目合伙人明细表").Rows(i)("项目编号") = "hhxm" & Format(idx,"000")
Next