Adding same characters to an existing field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with a text field named PGM. I want to take the existing data
and add "PGM-" to the beginning of the existing text. How do I do this?
 
If you want to update the table, then create an update query and use
something like the following in the "update to:" field...


= "PGM-"+[PGM]

(Using the "+" will cause it to only update if the field is not null.)



If you just want to DISPLAY the number in that format, but not update the
field, then there is a different method. That is what I would do, so your
users don't have to type in "PGM-" from this point forward. To do that, you
could...
1) Use the "format" feature in your forms or reports. You could a
2) Create a new column in a query and use that query as your data source for
forms and reports. The new column would be...

NewPGM: "PGM-"+[PGM]

3) Use an unbound text field on your forms and reports and fill it with =
"PGM-"+[PGM]




Personally, I'd use option 1, 2 or 3. I would not update my table.


Hope that helps,

Rick B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top