Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with "ADDING" a letter to numbers

Status
Not open for further replies.

Computethis

IS-IT--Management
Feb 5, 2001
28
0
0
US
I have a field called [JobNumber] I want to create a macro that will "add" the letter "Q" to the end of that JobNumber in the field [JobNumber]

Generally there are only 4 number places in the field but this could grow...

Example:

Current Field: Job Number: [ 1234 ]

Click Button

new and improved: Job Number: [ 1234Q ]


This is in a form all setup for data entry..

Thanks,
Mitch
 
You can do this with an update query...create a field called newjobnumber.
then create an update query

Field : Jobnumber

Update to: [NewJobNumber] & "Q"

This should work...

good Luck

 
The syntex would be

[JobNumber] = [JobNumber] & "Q"

This will work if this is a text field and not a number field. ljprodev@yahoo.com
Professional Development
MS Access Applications
 
Not sure I understand.. If I run a "update query would the other jobs in the database not be changed as well ????

I basically have one macro that "copies" using the "setValue" function three fields over to another table/form... In that second table/form I need to "add" that "Q" to the [JobNumber]...

Does that help or am I not getting this ???

Thanks!
Mitch
 
In your macro when you do the set value, instead of saying

= [JobNumber]

you should say
= [JobNumber] & "Q"

The ampersand will attach or concantenate and value that follows it to the value in front of it. Since Q is considered a string, you will need to put it in quotes.

Hope we are understanding you correctly. Hope this helps.
B-)
ljprodev@yahoo.com
Professional Development
MS Access Applications
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top