PC Review


Reply
Thread Tools Rate Thread

Create lookup-field programmatically?

 
 
=?Utf-8?B?a2VubnlrZWU=?=
Guest
Posts: n/a
 
      20th Jun 2005
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


 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      20th Jun 2005
Hi,
i think append query is a best solution for this, why it does not work? do
you get some error?


--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


"kennykee" <(E-Mail Removed)> wrote in message
news:F0CE6AB2-7348-4018-AC56-(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
=?Utf-8?B?a2VubnlrZWU=?=
Guest
Posts: n/a
 
      20th Jun 2005
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



"Alex Dybenko" wrote:

> Hi,
> i think append query is a best solution for this, why it does not work? do
> you get some error?
>
>
> --
> Alex Dybenko (MVP)
> http://Alex.Dybenko.com
> http://www.PointLtd.com
>
>
> "kennykee" <(E-Mail Removed)> wrote in message
> news:F0CE6AB2-7348-4018-AC56-(E-Mail Removed)...
> > 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
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create new field - If/Then, Lookup? hlock Microsoft Access 3 13th Mar 2010 06:03 PM
How do I programmatically create field names in a loop? M Skabialka Microsoft Access 7 31st Jul 2009 03:23 AM
How do I programmatically create field names in a loop? M Skabialka Microsoft Access Database Table Design 7 31st Jul 2009 03:23 AM
Create table from 2 existing databases, lookup with notes field Rick Microsoft Access Getting Started 2 12th Dec 2007 10:20 PM
how do I create up a lookup field that is longer than 255 characte =?Utf-8?B?RHJQYWRkeQ==?= Microsoft Access 3 5th Jul 2006 03:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:27 AM.