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

I am getting a validation error appending a table 1

Status
Not open for further replies.

AstroTek

Programmer
Apr 27, 2004
21
US
I am getting a validation error appending a table. I am trying to append two queries to a table.
 
What type of database?

Do you have any field level validation rules?

What does the error message say?

Are you sure that you are not trying to put a text value into a numeric field, or vice versa?

What is the syntax of your SQL?
 
I have a primary key. In the criteria of the append query I have is null or not null to solve the value errors. Also, I have changed the destination table description to match the source document. INSERT INTO Append1 ( [Bottler Nbr], bill_bp_ent_id, [BP Role ID], [Bottler Name], [Member Name], [Bottler City], [Bottler State], [Bottler Zipcode], [Size], [Product Description], [Product Quanity], [Member Address], [Member City], [Member State], [Member Zipcode], [Member Phone] )
SELECT Billingnumqry.[Bottler Nbr], Billingnumqry.bill_bp_ent_id, Billingnumqry.[BP Role ID], Billingnumqry.[Bottler Name], Billingnumqry.[Member Name], Billingnumqry.[Bottler City], Billingnumqry.[Bottler State], Billingnumqry.[Bottler Zipcode], Billingnumqry.Size, Billingnumqry.[Product Description], Billingnumqry.[Product Quanity], Billingnumqry.[Member Address], Billingnumqry.[Member City], Billingnumqry.[Member State], Billingnumqry.[Member Zipcode], Billingnumqry.[Member Phone]
FROM Billingnumqry
WHERE (((Billingnumqry.[Bottler Nbr]) Is Null Or (Billingnumqry.[Bottler Nbr]) Is Not Null) AND ((Billingnumqry.bill_bp_ent_id) Is Null Or (Billingnumqry.bill_bp_ent_id) Is Not Null) AND ((Billingnumqry.[BP Role ID]) Is Null Or (Billingnumqry.[BP Role ID]) Is Not Null) AND ((Billingnumqry.[Bottler Name]) Is Null Or (Billingnumqry.[Bottler Name]) Is Not Null) AND ((Billingnumqry.[Member Name]) Is Null Or (Billingnumqry.[Member Name]) Is Not Null) AND ((Billingnumqry.[Bottler City]) Is Null Or (Billingnumqry.[Bottler City]) Is Not Null) AND ((Billingnumqry.[Bottler State]) Is Null Or (Billingnumqry.[Bottler State]) Is Not Null) AND ((Billingnumqry.[Bottler Zipcode]) Is Null Or (Billingnumqry.[Bottler Zipcode]) Is Not Null) AND ((Billingnumqry.Size) Is Null Or (Billingnumqry.Size) Is Not Null) AND ((Billingnumqry.[Product Description]) Is Null Or (Billingnumqry.[Product Description]) Is Not Null) AND ((Billingnumqry.[Product Quanity]) Is Null Or (Billingnumqry.[Product Quanity]) Is Not Null) AND ((Billingnumqry.[Member Address]) Is Null Or (Billingnumqry.[Member Address]) Is Not Null) AND ((Billingnumqry.[Member City]) Is Null Or (Billingnumqry.[Member City]) Is Not Null) AND ((Billingnumqry.[Member State]) Is Null Or (Billingnumqry.[Member State]) Is Not Null) AND ((Billingnumqry.[Member Zipcode]) Is Null Or (Billingnumqry.[Member Zipcode]) Is Not Null) AND ((Billingnumqry.[Member Phone]) Is Null Or (Billingnumqry.[Member Phone]) Is Not Null));
 
The general syntax looks correct for a MS Access database:

Code:
INSERT INTO Destination_Table 
( 
  Field1, 
  Field2,  
  Field3 
)

SELECT 
  Field1, 
  Field2,  
  Field3 

FROM Source_Table;

You probably don't need that WHERE clause.

You mentioned that you have a key value... My guess that is that you are either inserting a duplicate key or that your key is an AutoNumber field.
 
At what point do I insert the code? I inserted it at the beggining only to recieve an error at the end of the insert into clause.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top