Append queries with added information

B

Bob Waggoner

I append the record of one table to another table and I want to add the same
text to one of the appended fields. "This comes from ConcernID #" and then
have the number inserted.

I can insert the number, I just haven't been able to get the text message to
go with it.

In the append to, I have written &"This comes from ConcernID #" & Comment
(Comment is the field I'm sending the concern id to).

I've tried to put it in the field name - that doesn't work.

I have access 2003.

Thanks for your help.
 
K

KARL DEWEY

You can not have a text message in a number field.
Post the SQL of what you tried and what is datatype of the fields.
 
B

Bob Waggoner

I'm trying to send a number field to a memo field with the added text "This
is the concernID". Here's the SQL (without the text).

INSERT INTO 852Complaints ( MgmtRevID, [Customer Code], [Customer Name],
Complaint, [Date of Complaint], Comments, PSID, hyperlink2 )
SELECT [852ConcernTable].MgmtRevID, [852ConcernTable].[Customer Code],
[852ConcernTable].[Customer Name], [852ConcernTable].Complaint,
[852ConcernTable].[Date of Complaint], [852ConcernTable].ConcernID,
[852ConcernTable].PSID, [852ConcernTable].CustDocuments
FROM 852ConcernTable
WHERE
((([852ConcernTable].ConcernID)=[forms]![852Complaintsform]![852ConcernFORM]![ConcernID]));
 
P

Piet Linden

I append the record of one table to another table and I want to add the same
text to one of the appended fields. "This comes from ConcernID #" and then
have the number inserted.

I can insert the number, I just haven't been able to get the text messageto
go with it.

In the append to, I have written &"This comes from ConcernID #" & Comment
(Comment is the field I'm sending the concern id to).

I've tried to put it in the field name - that doesn't work.

I have access 2003.

Thanks for your help.

post the SQL
It should be something along the lines of

"INSERT INTO DestinationTable(field1, field2) VALUES ('Value1', 'This
comes from ConcernID #'" & me.txtComment & " ')"
 
K

KARL DEWEY

Try this --
INSERT INTO 852Complaints ( MgmtRevID, [Customer Code], [Customer Name],
Complaint, [Date of Complaint], Comments, PSID, hyperlink2 )
SELECT [852ConcernTable].MgmtRevID, [852ConcernTable].[Customer Code],
[852ConcernTable].[Customer Name], [852ConcernTable].Complaint,
[852ConcernTable].[Date of Complaint], "This comes from ConcernID #"
&[852ConcernTable].ConcernID, [852ConcernTable].PSID,
[852ConcernTable].CustDocuments
FROM 852ConcernTable
WHERE
((([852ConcernTable].ConcernID)=[forms]![852Complaintsform][852ConcernFORM]![ConcernID]));
 

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

Top