Connecting Tech Pros Worldwide Forums | Help | Site Map

Novice looking for help - Automatically generate a purchase order number

Member
 
Join Date: Mar 2008
Location: Doylestown, PA
Posts: 44
#1: Nov 14 '08
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's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,000
#2: Nov 14 '08

re: Novice looking for help - Automatically generate a purchase order number


This should do the job:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboJobID_AfterUpdate()
  2.  Me.AnotherTextBox = Me.cboJobID & "-" & Format(Date, "yy")
  3. End Sub
Linq ;0)>
Member
 
Join Date: Mar 2008
Location: Doylestown, PA
Posts: 44
#3: Nov 14 '08

re: Novice looking for help - Automatically generate a purchase order number


Worked like a charm.
Thanks for your help!

Gary
missinglinq's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,000
#4: Nov 14 '08

re: Novice looking for help - Automatically generate a purchase order number


Glad we could help!

Linq ;0)>
Member
 
Join Date: Mar 2008
Location: Doylestown, PA
Posts: 44
#5: Nov 15 '08

re: Novice looking for help - Automatically generate a purchase order number


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
missinglinq's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,000
#6: Nov 15 '08

re: Novice looking for help - Automatically generate a purchase order number


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

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboJobID_AfterUpdate()
  2.   Me.AnotherTextBox = Me.cboJobID & "-" & Format(Date, "yy")
  3.   Me.txtJobName = Me.cboJobID.Column(1)
  4. 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)>
Member
 
Join Date: Mar 2008
Location: Doylestown, PA
Posts: 44
#7: Nov 16 '08

re: Novice looking for help - Automatically generate a purchase order number


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
Reply