ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Access·s¤â¡A§Ú²{¦b¦³¹J¨ì¦n´X­Ó°ÝÃD??

¸Õ¸Õ,¤£ª¾¬O§_¯àº¡¨¬celia»Ý¨D
Private Sub ³æ¸¹_DblClick(Cancel As Integer)
    Dim MaxID, date2 As String
    If Me.NewRecord = True Then
     date2 = Format(Date, "YYYYMMDD") '¤µ¤Ñ¤é´Á
     MaxID = DMax("[³æ¸¹]", "¸ê®Æªí1", "Left([³æ¸¹], 8) =" & date2)
     If IsNull(MaxID) Then
     Me![³æ¸¹] = date2 & "001" '¦pªG¤µ¤Ñ¨S¦³¬y¤ô¸¹¡A±q¤µ¤Ñ¤é´Á+"001"¶}©l
     Else
     Me![³æ¸¹] = date2 & Format(CStr(Val(Right(MaxID, 3) + 1)), "000") '¦pªG¤µ¤Ñ¦³¬y¤ô¸¹¡A«h±N³Ì¤j¬y¤ô¸¹¥[1
     End If
    End If
End Sub

TOP

        ÀR«ä¦Û¦b : ¯à·F¤£·F¡A¤£¦p­W·F¹ê·F¡C
ªð¦^¦Cªí ¤W¤@¥DÃD