Private Sub Command0_Click()
Dim i As Integer, A As String, B As Integer, Bh As String, newbh As String
For i = 1 To 26
A = Mid(zm, i, 1)
Bh = "JH1203001"
newbh = Bh & A
b=DCount("*", "TB1", "BH='" & newbh & "'")
If B = 0 Then
Text1.Value = newbh
Exit For
End If
Next i
End Sub