Private Sub Form_Load()
    
Dim mrc As ADODB.Recordset
Dim IDEID As StringtxtSQL = "select max(ID) from LeavelList"
Set mrc = ExcuteSql(txtSQL)
If IsNull(mrc.Fields(0).Value) ThenIDEID = "00000000"ElseIDEID = Right(mrc.Fields(0), 8)
    
    End IftxtID = "" & Right(Format$(Date, "YYYY"), 2) & Format$(Date, "MM") & Format$(CLng(IDEID + 1), "00000000") & ""End Sub