Hi Don,
To link the two forms so that form B always displays the customer selected
on form A, use the command button wizard to generate the code - it asks you
if you want to link the two forms by a unique id e.g.:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "formA"
stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
If you than want to insert data into form B, you need to put the following
in the before insert event of form B:
Me!CustomerID = Forms!formA!CustomerID
Make sure that form A cannot be closed whilst form B is open, otherwaise the
above will fall over.
However, if form B is already open when you select your record on form A,
base you recordset for form B on a query which gets selects the customer ID
from form A, then after selecting the record in form A, requery form B.
If you need an example of this, reply back and I'll send you a small example
DB.
Paul
> I'm struggling trying to get a CustomerID from one form to another ???
>
[quoted text clipped - 11 lines]
>
> Any assistance would sure be appreciated.
MN - 08 Mar 2005 19:03 GMT
Hi Paul,
Can you send an example, please.
Thanks a lot.
> Hi Don,
>
[quoted text clipped - 42 lines]
> >
> > Any assistance would sure be appreciated.