Novice looking for help - Automatically generate a purchase order number

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GLEberts
    New Member
    • Mar 2008
    • 51

    #1

    Novice looking for help - Automatically generate a purchase order number

    Novice looking for some direction!!

    I am trying to have a text box autopopulate with a number added to it at the end and I am having a difficult time doing this.

    Example:
    (1) I have a combo box [cbojobid]

    I would like to have a purchase order number automatically generated from that number to another text box

    What I would like to have have happen is when I click on the combo box [cbojobid] and choose the selection from the combo box to have the new text box automatically generate a purchase number with the JobID plus (-08)

    It would look like this:
    4567-08

    First four letters being the JobId and the (-08) being the last two numbers in the year.

    Can anyone help please.
    Thanks for your time.
    Gary
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    This should do the job:

    Code:
    Private Sub cboJobID_AfterUpdate()
     Me.AnotherTextBox = Me.cboJobID & "-" & Format(Date, "yy")
    End Sub
    Linq ;0)>

    Comment

    • GLEberts
      New Member
      • Mar 2008
      • 51

      #3
      Worked like a charm.
      Thanks for your help!

      Gary

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        Glad we could help!

        Linq ;0)>

        Comment

        • GLEberts
          New Member
          • Mar 2008
          • 51

          #5
          Second Question -
          The suggestion you gave me work great.
          What would be helpful also is to have the job name automatically populate onto the form also into another text box [txtjobname]

          What I have is when I click on the combobox [cbojobid] I have four headings to view simply for reference purposes to select the correct project.

          First - JobId
          Second - Completename
          Third - Date
          Fourth - Jobamount

          I have worked for hours on this with no success.
          Any suggestions would be appreciated.
          Thanks
          Gary

          Comment

          • missinglinq
            Recognized Expert Specialist
            • Nov 2006
            • 3533

            #6
            Is the second field, CompleteName, the value you want to populate txtJobName? If so:

            Code:
            Private Sub cboJobID_AfterUpdate()
              Me.AnotherTextBox = Me.cboJobID & "-" & Format(Date, "yy")
              Me.txtJobName = Me.cboJobID.Column(1)
            End Sub
            once again with actual textbox name in place of

            AnotherTextBox.

            If CompleteName is not the same as Job Name, where is the data for Job Name stored?

            Linq ;0)>

            Comment

            • GLEberts
              New Member
              • Mar 2008
              • 51

              #7
              unbelivable - I tried this one so many different ways and completly blew off the (column1) - now that i see it - it makes so much sense.
              thanks for your help again.
              Gary

              Comment

              Working...