Dim daoRs3 As ADODB.Recordset
Dim Conn1 As ADODB.Connection
Dim str as String
strSql = "SELECT MAX(COLUNM1) AS MAX_NO1 FROM T1 WHERE COLUNM1 LIKE 'CE" & Format(now, "yyyymmdd") & "*'"
Set daoRs3 = New ADODB.Recordset
Set Conn1 = CurrentProject.Connection
daoRs3.Open strSql, Conn1, 3,3
If daoRs3.RecordCount <> 0 Then
str = daoRs3("MAX_NO1")
End If