Invoice Numbers - bound control issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • samdev

    #1

    Invoice Numbers - bound control issue

    I need to set up invoices so each new invoice has next available number
    assigned.

    I have a table Named "InvoiceNumbers " that has a single field =
    "nextnumber "

    A 2nd table that contains the sales transaction info including a field
    named "invno".

    Then created a form to input the sales and in the form is where I want
    the number to update for each new invoice.

    What I have done so far is set up code in the form (BeforeInsert event)
    as follows:

    Me.Invno=NZ(Dma x("[InvoiceNumbers]","[NextNumber]"))+1
    Me.Dirty=False

    What is happening is the first invoice will update by 1 and then any
    other new invoices will duplicate that same invoice #.

    What I'm missing is set up a bound between the field "Invno" and
    "nextnumber " - I'm not sure how to do that - I have tried to go into
    the control source of the field "invno" in the form and set it up but
    keep getting a #Name? error.

    I was able to get most of this from the newsgroup but need a bit more
    assistance. Thx.

  • John Welch

    #2
    Re: Invoice Numbers - bound control issue

    Not sure why you need to have a separate table to just hold the "next
    number"
    why not use the invoices table itself:
    Me.Invno=NZ(Dma x("[Invno]","[2ndTable]"))+1

    If you search google groups, you should see lots of examples of homemade
    autonumber generation.
    -John

    "samdev" <laura@noblesof twaresolutions. comwrote in message
    news:1158035218 .314998.64340@i 3g2000cwc.googl egroups.com...
    >I need to set up invoices so each new invoice has next available number
    assigned.
    >
    I have a table Named "InvoiceNumbers " that has a single field =
    "nextnumber "
    >
    A 2nd table that contains the sales transaction info including a field
    named "invno".
    >
    Then created a form to input the sales and in the form is where I want
    the number to update for each new invoice.
    >
    What I have done so far is set up code in the form (BeforeInsert event)
    as follows:
    >
    Me.Invno=NZ(Dma x("[InvoiceNumbers]","[NextNumber]"))+1
    Me.Dirty=False
    >
    What is happening is the first invoice will update by 1 and then any
    other new invoices will duplicate that same invoice #.
    >
    What I'm missing is set up a bound between the field "Invno" and
    "nextnumber " - I'm not sure how to do that - I have tried to go into
    the control source of the field "invno" in the form and set it up but
    keep getting a #Name? error.
    >
    I was able to get most of this from the newsgroup but need a bit more
    assistance. Thx.
    >

    Comment

    • samdev

      #3
      Re: Invoice Numbers - bound control issue

      Thank you!, Thank you....what I was trying to do was from the groups
      and couldn't get it to work - your solution was very simple! Thank you!


      John Welch (remove remove) wrote:
      Not sure why you need to have a separate table to just hold the "next
      number"
      why not use the invoices table itself:
      Me.Invno=NZ(Dma x("[Invno]","[2ndTable]"))+1
      >
      If you search google groups, you should see lots of examples of homemade
      autonumber generation.
      -John
      >
      "samdev" <laura@noblesof twaresolutions. comwrote in message
      news:1158035218 .314998.64340@i 3g2000cwc.googl egroups.com...
      I need to set up invoices so each new invoice has next available number
      assigned.

      I have a table Named "InvoiceNumbers " that has a single field =
      "nextnumber "

      A 2nd table that contains the sales transaction info including a field
      named "invno".

      Then created a form to input the sales and in the form is where I want
      the number to update for each new invoice.

      What I have done so far is set up code in the form (BeforeInsert event)
      as follows:

      Me.Invno=NZ(Dma x("[InvoiceNumbers]","[NextNumber]"))+1
      Me.Dirty=False

      What is happening is the first invoice will update by 1 and then any
      other new invoices will duplicate that same invoice #.

      What I'm missing is set up a bound between the field "Invno" and
      "nextnumber " - I'm not sure how to do that - I have tried to go into
      the control source of the field "invno" in the form and set it up but
      keep getting a #Name? error.

      I was able to get most of this from the newsgroup but need a bit more
      assistance. Thx.

      Comment

      Working...