By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

Novice looking for help - Automatically generate a purchase order number

P: 51
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
Nov 14 '08 #1
Share this Question
Share on Google+
6 Replies


missinglinq
Expert 2.5K+
P: 3,532
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)>
Nov 14 '08 #2

P: 51
Worked like a charm.
Thanks for your help!

Gary
Nov 14 '08 #3

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help!

Linq ;0)>
Nov 14 '08 #4

P: 51
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
Nov 15 '08 #5

missinglinq
Expert 2.5K+
P: 3,532
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)>
Nov 15 '08 #6

P: 51
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
Nov 16 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.