Create lookup-field programmatically?

G

Guest

Hi all,

I got two forms , both forms are identical but different source .Both are
Invoice. Just like in Northwind, it got one main form and one subform.

Question:

How to copy and paste the records in the "subform only" form one invoice
form to another invoice form's subform?

Let say the form name is A and B
I need each page in A for each page in B.

In short,
How to copy recordsets in a subform and paste to another subform?

Any solutions?

I tried append query but cant work.

Thanks in advance.

Kennykee
 
A

Alex Dybenko

Hi,
i think append query is a best solution for this, why it does not work? do
you get some error?
 
G

Guest

Yes, I got error
I cant append lookup field to a lookup field because key violation.
Lookup fields contains ID which is unique

Below is the lookups statements

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;

I actually trying to copy records in subform and put it on another form's
subform

eg

Form Cus.Detail IndMain
Subform Pro.Bought IndBuy

Pro.Bought(copied)==>Indbuy(pasted) for (every Page in Cus.Detail for every
page in IndMain)

Actually, I dont want the IDs and anything in form but i want the records in
subform.

Imagine:

You have two invoice. I am sure there is field "Bill To". The first invoice
is bill to customer. But the second invoice is billed to someone else but
exactly same item bought.
In a company, there is two division company ie marketing and industry.
Industry bill to marketing and then marketing bill to customer. For not
wasting time, I need to type the data in either one invoice and the data in
that particular invoice will be automatically copied and pasted to the
another invoice.


In conclusion, both invoices are just like photocopy/clone to each other but
different "billed to". The only similar is the subform records.

The reason i make two form because both Marketing and Industry Invoice
affect their own stock reduction system respectively

If you still need more explanation, please inform me.

Any ideas?

Thanks very very very much for the help

kennykee
 

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