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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text & Data in a Table Field

Status
Not open for further replies.

davisto01

MIS
Jul 11, 2003
21
US
I’m using an append query to generate an error report table based on various other queries.
Is there a way to incorporate in the Error Report Table text strings AND the data from the various queries?

For example … in the Error Report Table, I would like to have something like:
There are _____ Duplicate Products in the product table.
The ____, _____, and _____ are Reptiles and should not be in the Mammals table.

A syntax example would do wonders.

Thanks.
 
yes. use the & (ampersand) to concantonate text strings.

in your query that figures out Duplicate Products, do you actually figure out how many? i suppose you end up with a list of duplicates in your query? so then write another query, an append query to add your error record to this log table.

="There are " & dcount("ID","DuplicatesQueryName") & " duplicate Products in the Products Table"

as for the reptile one, the simplest is to do it one at a time. you could do this right in the query that finds the reptiles, make it an append query to add it to your error table:

=[ReptileFieldName] & " is a Reptile and should not be in the Mammals table."

if you want to actually LIST the reptiles, separated by commas like in your example, that involves more intricate code. let me know if you want to proceed, i'll need more info.



 
by the way--as for DUPLICATE PRODUCTS--why not set up some validation so no one can enter duplicates to begin with?
also, why not make it so no one can enter reptiles in the mammals table?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top