Use query to insert text before existing text?

bigalpha

Registered User.
Local time
Yesterday, 20:43
Joined
Jun 22, 2012
Messages
415
I would like to insert a string of text at the beginning of whatever else in a cell.

For example, the cell may contain: "1E. Aerosol cleaners containing non-halogenated solvents and petroleum distallates."

I would like to insert this: "1G. Product not acceptable for the material reuse program." right before "1E. Aerosol cleaners containing non-halogenated solvents and petroleum distallates."

I know I can run an update query to just add 1G after the 1E, but I need this in alphabetical order.

TIA
 
An Update query along these lines

Update MyTable set currenttextfield = newtext & currenttextValue

where criteria here to get unique records
 
An Update query along these lines

Update MyTable set currenttextfield = newtext & currenttextValue

where criteria here to get unique records

What if there is no standard text existing in the records?
 
Well then just insert your new text.

The currenttextValue would be zero length string.
 
Well then just insert your new text.

The currenttextValue would be zero length string.

What I mean is that there is text in those fields, but the text isn't the same between each field.
 
Perhaps my response is vague because I'm now guessing at the details of your question.
We're talking Access, so there are no cells.
If you have texts to be inserted (prepended) to fields in existing records, then you will need to have these texts, and the records (record ids or some identifier) to which they apply, stored in some manner.

You can run a query or some vba to read the table and insert each new text string in the field in the appropriate record in the existing table.
 
Perhaps my response is vague because I'm now guessing at the details of your question.
We're talking Access, so there are no cells.
If you have texts to be inserted (prepended) to fields in existing records, then you will need to have these texts, and the records (record ids or some identifier) to which they apply, stored in some manner.

You can run a query or some vba to read the table and insert each new text string in the field in the appropriate record in the existing table.

I know there aren't "cells" like in a typical Excel format. I didn't know the best word to use in that instance.

I tried to Google this problem but didn't really find what I needed to solve it. I really just need to be able to insert some text string at the beginning of whatever text is already existing for the field; the existing text may not be the same between each record.
 

Users who are viewing this thread

Back
Top Bottom