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!

Update one field from multiple fields

Status
Not open for further replies.

JCRMet

Technical User
Jun 21, 2001
11
0
0
US
I am receiving a data file which has 8-10 discrete pieces of information which I am filing into separate fields. However, I have another field, a 'notes' field into which I'd like to insert literals for each of the data points. i.e. if the customer indicates he/she wants to purchase $250,000 of insurance, I insert 250k into an amount field, but I want my notes field to read "Interested in purchasing 250k of insurance". The trick is, I want to update this note field from several different fields - the above stated amount, a reason for interest, date of birth etc. I do this routinely with code like that shown below, but I do it at the record level - information is entered on a form and the 'file record' button executes the code. In this case, I want to append the records and
then pull the data from the various fields and insert the literals into notes. I don't know how to do it in an update query rather than at the individual record level. What do I put in the QBF grid?

Appnotes = "This is an Lead. " & [CUS_FNAME] & " has requested to speak to an FSR about "
Appnotes = Appnotes & "purchasing additional " & [META_FLD14] & " insurance. "
Appnotes = Appnotes & "The purpose of this insurance is " & [PRD_INT_CMNT] & ". "
Appnotes = Appnotes & Sex2 & " current level of insurance is " & [META_FLD17]
 
If I have this right, you have a table (if you dont have a table, stop now) with x records populated with data in all of the relevant fields EXCEPT the notes field, which you want to update to show the sentence above with the field values in place in the sentence. If this is correct:
1. backup your database
2. create a new query
3. add the table that contains these values to the query
4. drag and drop the Notes field into the grid
5. change the query to an UPDATE query (on the query menu)
6. in the 'Update To' cell for the Notes field, type the following (if your field names in the table do not match the control names below, you must replace the control names below with your table field names):
"This is a Lead. " & [CUS_FNAME] & " has requested to speak to an FSR about purchasing additional " & [META_FLD14] & " insurance. The purpose of this insurance is " & [PRD_INT_CMNT] & ". " & [SEX2] & " current level of insurance is " & [META_FLD17]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top