要在:
=================================
Private Sub Form_Load()
    End Sub
====================================
里取一最大值~!数据表“LeavelList”,取最大值子段“ID”请帮忙。

解决方案 »

  1.   

    SELECT MAX([ID]) FROM LeavelList
      

  2.   

    请写出详细语句。这一句,我都会================================================
    Private Sub Form_Load()
        
    Dim mrc As ADODB.Recordset
    Dim IDEID As StringSQL = "select max([ID]) as IDmax from LeavelList"If IDmax <> Empty ThenIDEID = "00000000"ElseIDEID = Right(Str(IDmax), 8)End IftxtID = "" & Right(Format$(Date, "YYYY"), 2) & Format$(Date, "MM") & Format$(CLng(IDEID + 1), "00000000") & ""End Sub======================================
    我是这样写的,不知对不对~~~