How to Create Auto Numbering in Ms Access that Automatically Reset every year or every month.

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 53

  • @DonRamonLoco
    @DonRamonLoco 2 роки тому +1

    Excellent!!! Keep going! And thank you for this video. Very helpful for me!!

  • @iammai5404
    @iammai5404 Рік тому +1

    Great tutorial, very helpful and very clever.

  • @bck4589
    @bck4589 2 роки тому +1

    Thank you sir,❤️ from India

  • @56cridwan
    @56cridwan 9 місяців тому +1

    thanks for the video, very helpful

  • @boodygarcia5874
    @boodygarcia5874 2 роки тому

    Thank you you Sir Edcelle!

  • @bajront66
    @bajront66 Рік тому +1

    Greetings. Sir, you explained this really professionally, but I can't do what I need and that's why I need your help. Namely, the Invoice number must be reset annually, but it should contain the first and last letter of the month, then the Invoice number and at the end the year, for example:
    JY-1/2021, JY-2/2021; FY-3/2021, FY-4/2021, FY-5/2021; MH-6/2021 etc.
    JY-1/2022, JY-2/2022; FY-3/2022...
    Can you help me with this please?

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  Рік тому

      Actually same procedure but you have to add the LEFT and RIGHT FUNCTION. It's a complex process so i will create a video about this soon.

  • @patriknemec6253
    @patriknemec6253 8 місяців тому

    Hi Mr Gulfan, what is VBA Code when I delete last invoice and then create new with the same number. For example I delete invoice 2023002 and then create new with number 2023002. 🙏

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  8 місяців тому

      Why not delete only the records inside that invoice?

  • @naughtynaughty6453
    @naughtynaughty6453 Рік тому

    Hi Sir, I am currently working on a project similar to this, it's just that I'm using ms excel as my front-end and ms access as the back-end. My challenge is that there are multiple users simultaneously creating record/tickets. Do you have any suggestions how it can be implemented? Thank you.

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  Рік тому

      Multiple-user at the same time in excel is not doable. Either you work in a Read Only Mode or the one who can save record is the last user.
      Why not use Access instead of excel?

    • @naughtynaughty6453
      @naughtynaughty6453 Рік тому

      @@EdcelleJohnGulfan I am not used to in ms access forms...all my previous projects are in excel - access set up since it is much more like the old VB6.0 and ms access tandem. I was able to create something but it's a hit and miss. I have 4 users creating tickets simultaneously. We are all trying to click the command button at the same time and after a couple of attempts (5 to 6 entries each users) one would encounter an error with the database connection which I couldn't properly troubleshoot...To give you a background the functions invoked when the command button is clicked:
      1.) It will make a query to retrieve the max id (auto_number primary key) and the max series (indexed - no duplicate) and store them in variables: max_id and max_series
      2.) It will insert a record just to create an initial entry to the table in the database and to determine the order of the auto_number generated. This is my work-around for the multi-user simultaneously creating record.
      3.) It will query the last record created and then compare it to the max id. Ex. the max_id is 10 and the last id stored in step 2 is 14 then it means I'll be needing to add 4 in my step 4 to generate the ticket number based on the max_series.
      4.) Update the series by adding the difference of the last id stored and the max id to the max_series...
      Not sure if I explained it clearly. But like I said it's a hit and miss. I know it's not the best approach and I'm still trying to make a work around and hopefully I sort it out.

  • @sheikhobaba
    @sheikhobaba Рік тому +1

    Great

  • @japmanumbali8001
    @japmanumbali8001 2 роки тому +1

    How to create invoicenumber and seriesnumber in to 4 digits like 0001. Thanks

  • @amrelnaggar4509
    @amrelnaggar4509 Рік тому

    I need your help, if I have a table with data entry form. This table contains fields (Order date, Total cost, first payment, second payment, Rest and paid date). Rest= Total cost - first payment - second payment. what I need is to have the paid date (now date when the order is paid) filled automatically under only two conditions, when the Total cost > 0 and Rest =0 (which means that the order is paid). Also how to prevent order modification after it is paid. Would you help me with that , please.

  • @toutypasse44000
    @toutypasse44000 2 роки тому

    salut je suis content de la solution

  • @patriknemec6253
    @patriknemec6253 Рік тому

    Hi Mr Gulfan, I would like to set my invoice number like 2023001, …and I do not know hot to set three numbers at the end of invoice number. Now I have 20231,…numbering. I have tried your another video. But it does not work. Please help. 🙏🙏 Many thanks.

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  Рік тому

      Have you seen this video? ua-cam.com/video/ux8IndMuA6M/v-deo.htmlsi=thKrnyQWNLVynxwu
      Well, if not, watch the video and apply this format.
      sample:
      Me.Invoice_Number= Format(Date, "yyyy") & Format(Your_autonumber, "000")

  • @seshadrisrikant
    @seshadrisrikant 2 роки тому

    When i am running the form for the new year its showing invalid use of null (Error 94) . How to solve this

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  2 роки тому +1

      If That's the error, you are using or referring the null or empty field.
      To fixed it. Put NZ FUNCTION to the code that has an error.

  • @Pusii174
    @Pusii174 Рік тому

    hello, I tried this but unfortunately it stops at 10...error after 10 input datas...may I ask why? Can you please check the vba, Thank you

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  4 місяці тому

      I have mistake in my coding. 1:14 series number, the data type must be Number not a short text.

  • @murealnoauy
    @murealnoauy 6 місяців тому

    From the example you did, it was very good. But I would like to add the ID number to 0001, 0002. What should I do?
    2023-04-1 to 2023-04-0001
    2023-04-2 to 2023-04-0002
    2022-01-1 to 2022-01-0001

    • @TheOrangeGecko
      @TheOrangeGecko 4 місяці тому

      Change the line "Me.SeriesNumber = InvNext" to
      Me.SeriesNumber = Format(InvNext, "0000")

  • @admiralrichvi
    @admiralrichvi 2 роки тому

    How to make it reset each fiscal year ?

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  2 роки тому

      Hi thanks for asking.
      Same procedure but you need to set up first your fiscal date as your variable (September + Year)

    • @admiralrichvi
      @admiralrichvi Рік тому

      If you going to use max ID for the series number, how to rest the numbering for the new fiscal? I have 101-2023, combined series with year.@@EdcelleJohnGulfan

  • @kidsworld7459
    @kidsworld7459 Рік тому

    Hi sir, I want to create unique index number for customers. I want to get first letter of Coustomer name with number such as A001, A002, B001, C001, C002 etc. Please help me.

  • @moyal3455
    @moyal3455 2 роки тому

    This method does not work when records go above 10. System error that value has been duplicated.

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  2 роки тому

      Thanks for the info but im using this since 2013 and i don't have problem. You can avoid the duplicate values if you combine the year+month+series number.

    • @moyal3455
      @moyal3455 2 роки тому +4

      @@EdcelleJohnGulfan This actually resolved the error: vlast = DMax("Val([SeriesNumber])", "invoice", "InvYear='" & Me!invyear.Value & "'").

    • @admiralrichvi
      @admiralrichvi 2 роки тому

      This happening to me as well

    • @MaraingMuong168
      @MaraingMuong168 2 роки тому

      @@moyal3455 Thank you very much thank you

    • @NoumanAzam01
      @NoumanAzam01 Рік тому

      @@moyal3455 So great of u Moya L

  • @elvesreis2235
    @elvesreis2235 Рік тому

    I tried this but it does not increment :Private Sub Form_BeforeInsert(Cancel As Integer)
    Dim Vlast As Variant
    Dim InvNext As Integer
    Me.Invyear = Format(Date, " YYYY ") & "-" & Format(Date, "mm")
    Vlast = DMax("SeriesNumber", "Invoice ", " InvYear =' " & Me.Invyear.Value & "'")
    If IsNull(Vlast) Then
    InvNext = 1
    Else
    InvNext = Vlast + 1

    End If
    Me.SeriesNumber = InvNext
    End Sub

  • @kiranarana7274
    @kiranarana7274 Рік тому

    Please help I get aan Syntax error (missing operator) in query expression InvYear=*2023*
    Private Sub Form_BeforeInsert(Cancel As Integer)
    Dim vLast As Variant
    Dim InvNext As Integer

    Me.InvYear = Format(Date, "YYYY")
    vLast = DMax("SeriesNumber", "Invoice", "InvYear=*" & Me.InvYear.Value & "*")


    If IsNull(vLast) Then
    InvNext = 1

    Else

    InvNext = vLast + 1

    End If

    Me.SeriesNumber = InvNext
    End Sub

    • @yasirkhan-mw1zr
      @yasirkhan-mw1zr Рік тому

      Me.InvYear = Format(Date, "YYYY")
      vLast = DMax("SeriesNumber", "Invoice", "InvYear='" & Me.InvYear.Value & "'")

  • @Stache987
    @Stache987 Рік тому

    Auto numbers used for keys are NOT for you, no need to reset them, it only opens up corruption

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  Рік тому

      YES I ABSOLUTELY UNDERSTAND.
      Let's say... You have a database under testing and after you finalize it, client wants to start from 0, what will you do?

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  Рік тому

      But this method is resetting the numbering variables and not the auto numbers.

  • @patriknemec6253
    @patriknemec6253 8 місяців тому

    ⁠​​⁠@EdcelleJohnGulfan because it is made for wrong customer.

  • @Pusii174
    @Pusii174 Рік тому

    hello, I tried this but unfortunately it stops at 10...error after 10 input datas...may I ask why? Can you please check the vba, Thank you

    • @Pusii174
      @Pusii174 Рік тому

      I wish to create a field that shows, mm-"9999"-yyyy, the "9999" is the unique ID autonumber, please help thank you!

    • @EdcelleJohnGulfan
      @EdcelleJohnGulfan  4 місяці тому

      I have mistake in my coding. 1:14 series number, the data type must be Number not a short text.