Append Lookup!!!!!!!!!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can i append lookup field?
I try to append lookup field but error on key violations

Any solutions or alternative for this method?

Thanks in advance

Kennykee
 
You can append dlookup e.g
INSERT INTO MyTable ( MyField)
VALUES DLookUp("FieldName","TableName","WhereCrit")

If that what you looking for, about the key violation you need to check
Three things
1. MyBe the key you trying to enter allready exist
2. One of the field in the table doesnt allow null values, and you not
entering a value into it.
3. Are you inserting a value to the key field.
 
Thanks Ofer,

Below is the lookup SQL statement
Two Table : "Customer Details" and "IndMain"

Is there anything may cause key violation?

SELECT [ID] AS xyz_ID_xyz, [Customer Name] & ', ' & [Contact Number] & ', ' &
[Address] AS xyz_DispExpr_xyz, [Customer Name], [Contact Number], [Address]
FROM [Customer Details] ORDER BY [Customer Name], [Contact Number],
[Address];

SELECT IndMain.ID AS xyz_ID_xyz, [Customer Name] & ', ' & [Contact Number] &
', ' & [Address] AS xyz_DispExpr_xyz, IndMain.[Customer Name],
IndMain.[Contact Number], IndMain.Address FROM IndMain ORDER BY
IndMain.[Customer Name], IndMain.[Contact Number], IndMain.Address;

Is it possible to append lookup fields?

Any solutions to the above?

Thanks.

Kennykee
 
Is this post connected to the post you had with Alex? If so please post the
code you have.
There should not be any problem appending this records, unless you trying to
append an existing record, before deleting the prev one.
Or check the fields in the table you trying to append to.

The message you getting indicating that you have no problem with the query,
the problem you have is with the records you trying to append.
Check the keys, check the values, and check the fields if any of them said
no null value, or unique value.

kennykee said:
Thanks Ofer,

Below is the lookup SQL statement
Two Table : "Customer Details" and "IndMain"

Is there anything may cause key violation?

SELECT [ID] AS xyz_ID_xyz, [Customer Name] & ', ' & [Contact Number] & ', ' &
[Address] AS xyz_DispExpr_xyz, [Customer Name], [Contact Number], [Address]
FROM [Customer Details] ORDER BY [Customer Name], [Contact Number],
[Address];

SELECT IndMain.ID AS xyz_ID_xyz, [Customer Name] & ', ' & [Contact Number] &
', ' & [Address] AS xyz_DispExpr_xyz, IndMain.[Customer Name],
IndMain.[Contact Number], IndMain.Address FROM IndMain ORDER BY
IndMain.[Customer Name], IndMain.[Contact Number], IndMain.Address;

Is it possible to append lookup fields?

Any solutions to the above?

Thanks.

Kennykee






Ofer said:
You can append dlookup e.g
INSERT INTO MyTable ( MyField)
VALUES DLookUp("FieldName","TableName","WhereCrit")

If that what you looking for, about the key violation you need to check
Three things
1. MyBe the key you trying to enter allready exist
2. One of the field in the table doesnt allow null values, and you not
entering a value into it.
3. Are you inserting a value to the key field.
 
You are probably getting key violations because you are trying t
append data to a primary key that is duplicated. In the design fo
the table that you are appending to, delete the primary key. Is thi
for archive purposes
 
Thanks all.
I know why I cant append query on lookup fields, the lookup fields contain
ID which is not duplicable

The table is for archive purpose

So I will try append programmatically. I will post my question to
programming sections.

Thanks.

Kennykee
 
Back
Top