OfficeÖйúÂÛ̳/AccessÖйúÂÛ̳

 ÕÒ»ØÃÜÂë
 ×¢²á

QQ怬

Ö»ÐèÒ»²½£¬¿ìËÙ¿ªÊ¼

·µ»ØÁÐ±í ·¢ÐÂÌû
²é¿´: 28616|»Ø¸´: 153
´òÓ¡ ÉÏÒ»Ö÷Ìâ ÏÂÒ»Ö÷Ìâ

[Ä£¿é/º¯Êý] [Ô­´´Ô´Âë·ÖÏí]Ö»Óм¸ÐдúÂëµÄ×Ô¶¨Òå×Ô¶¯±àºÅº¯Êý

[¸´ÖÆÁ´½Ó]
Ìøתµ½Ö¸¶¨Â¥²ã
1#
·¢±íÓÚ 2008-6-10 16:43:27 | Ö»¿´¸Ã×÷Õß »ØÌû½±Àø |µ¹Ðòä¯ÀÀ |ÔĶÁģʽ
Í·¼¸Ìì×ö¶«Î÷µÄʱºòÏëµ½µÄÒ»¸ö˼·£¬ÏÖÔÚ¿ÕÏÂÀ´ÍêÉÆһϷ¢ÉÏÀ´ºÍ´ó¼Ò·ÖÏí
  1. '========================================================================================
  2. '-º¯ Êý Ãû£º AutoNumber
  3. '-º¯ÊýÓÃ;£º ÉèÖÃ×Ô¶¨Òå×Ô¶¯±àºÅ
  4. '-²ÎÊý˵Ã÷£º ²ÎÊý1£ºPrefixal----±àºÅǰ׺
  5. '- ²ÎÊý2£ºDigit----±àºÅλÊý
  6. '- ²ÎÊý3£ºFieldName----×Ô¶¯±àºÅËùÔÚ×Ö¶ÎÃû
  7. '- ²ÎÊý4£ºTableName----×Ô¶¯±àºÅËùÔÚ±íÃû
  8. '-·µ»Ø²ÎÊý£º µ÷Óóɹ¦·µ»Ø½«ÒªÏòмǼÖÐÌí¼ÓµÄ×î´ó±àºÅ£¬µ÷ÓÃʧ°Ü·µ»Ø¿Õ×Ö·û´®""
  9. '-µ÷Ó÷½·¨£º ÔÚ´°ÌåµÄCurrent(µ±Ç°)ʼþÖе÷ÓÃ
  10. '-µ÷ÓÃʾÀý£º Me.×Ô¶¯±àºÅ.DefautValue = AutoNumber("[Éó]",7,"×Ô¶¯±àºÅ","ÉóºË±í")
  11. '-ʹÓÃ×¢Ò⣺ ±íÖеÄ×Ô¶¯±àºÅ×Ö¶ÎÊý¾ÝÀàÐÍÒªÉè³ÉÎı¾ÐÍ
  12. '-×÷ Õߣº ºì³¾ÈçÑÌ
  13. '-
  14. '=============================================================================================
  15. Function AutoNumber(Prefixal As String, Digit As Integer, FieldName As String, TableName As String) As String
  16. On Error GoTo AutoNumber_Err

  17. Dim strMaxID As Long
  18. Dim strNumberFormat As String
  19. Dim i As Integer

  20. strMaxID = Nz(DMax("Right( " & FieldName & "," & Digit & ")", TableName)) + 1
  21. For i = 1 To Digit
  22. strNumberFormat = strNumberFormat & "0"
  23. Next
  24. AutoNumber = """" & Prefixal & Format(strMaxID, strNumberFormat) & """"

  25. AutoNumber_Exit:
  26. Exit Function

  27. AutoNumber_Err:
  28. AutoNumber = ""
  29. MsgBox Err.Number & vbCrLf & Err.Description, vbCritical, "×Ô¶¯±àºÅ³ö´í"
  30. Resume AutoNumber_Exit
  31. End Function
¸´ÖÆ´úÂë
Óοͣ¬Èç¹ûÄúÒª²é¿´±¾ÌûÒþ²ØÄÚÈÝÇë»Ø¸´

±¾Ìû×ÓÖаüº¬¸ü¶à×ÊÔ´

ÄúÐèÒª µÇ¼ ²Å¿ÉÒÔÏÂÔØ»ò²é¿´£¬Ã»ÓÐÕʺţ¿×¢²á

x

ÆÀ·Ö

²ÎÓëÈËÊý 1¾­Ñé +5 ÊÕÆð ÀíÓÉ
tanhong + 5 Ô­´´ÄÚÈÝ

²é¿´È«²¿ÆÀ·Ö

·ÖÏíµ½:  QQºÃÓѺÍȺQQºÃÓѺÍȺ QQ¿Õ¼äQQ¿Õ¼ä ÌÚѶ΢²©ÌÚѶ΢²© ÌÚѶÅóÓÑÌÚѶÅóÓÑ
ÊÕ²ØÊÕ²Ø4 ·ÖÏí·ÖÏí ·ÖÏíÌÔÌû ¶©ÔĶ©ÔÄ
2#
·¢±íÓÚ 2008-6-10 17:17:16 | Ö»¿´¸Ã×÷Õß
ºÜʵÓõŦÄÜ [:12]
3#
·¢±íÓÚ 2008-6-10 17:27:19 | Ö»¿´¸Ã×÷Õß
Ö§³Ö [:24]

µã»÷ÕâÀï¸øÎÒ·¢ÏûÏ¢

4#
·¢±íÓÚ 2008-6-10 17:59:42 | Ö»¿´¸Ã×÷Õß
²»Äܲ»Ö§³ÖÒ»ÏÂ!
5#
 Â¥Ö÷| ·¢±íÓÚ 2008-6-10 18:13:03 | Ö»¿´¸Ã×÷Õß
Ææ¹Ö£¬ÎÒÔÚ£±Â¥µÄ´úÂëÊÇÖ±½Ó¸´ÖƹýÀ´µÄ£¬×îºó´íÎó´¦ÀíÄǶùÓ¦¸ÃÊÇAutoNumber=""µÄ£¬ÔõôֻÏÔʾAut£¬¸Ä¶¼¸Ä²»ÁË

6#
·¢±íÓÚ 2008-6-10 19:06:40 | Ö»¿´¸Ã×÷Õß
ѧϰ
[:50] [:50] [:50]
7#
·¢±íÓÚ 2008-6-10 21:23:54 | Ö»¿´¸Ã×÷Õß
[:34] [:34] [:34]

µã»÷ÕâÀï¸øÎÒ·¢ÏûÏ¢

8#
·¢±íÓÚ 2008-6-10 22:46:46 | Ö»¿´¸Ã×÷Õß
ѧϰ£¡Ð»Ð»£¡[:50]

µã»÷ÕâÀï¸øÎÒ·¢ÏûÏ¢

9#
·¢±íÓÚ 2008-6-11 00:55:02 | Ö»¿´¸Ã×÷Õß
¸´ÖƵ½Ð´×Ö°å,ÔÙ¸´ÖƹýÀ´ÊÇ·ñ¿ÉÒÔ?
10#
 Â¥Ö÷| ·¢±íÓÚ 2008-6-11 01:32:14 | Ö»¿´¸Ã×÷Õß
Õ¾³¤ÀÏ´ó,»¹ÊDz»Ðа¡,ÎÒÊÖ¶¯¸Ä¹ýºó²»ÐÐ,¸´ÖƵ½¼Çʱ¾ºÍд×Ö°åºóÔÙ¸´ÖƹýÀ´È«¶¼²»ÐÐ,ÊDZ»ÆÁ±ÎµôÁË,»¹ÊÇÔõô»ØÊÂ,Ì«Ææ¹ÖÁË
ÄúÐèÒªµÇ¼ºó²Å¿ÉÒÔ»ØÌû µÇ¼ | ×¢²á

±¾°æ»ý·Ö¹æÔò

QQ|Õ¾³¤ÓÊÏä|СºÚÎÝ|ÊÖ»ú°æ|OfficeÖйú/AccessÖйú ( ÔÁICP±¸10043721ºÅ-1 )  

GMT+8, 2025-1-10 15:03 , Processed in 0.099284 second(s), 36 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí