linking to two subforms

C

Chris

Hi all,

On a form I have two subforms:
1. continuous form to enter client names and places (name to type, place to
choose from combobox)
2. single form to enter information on the sales talk

What I would like to achieve is that after entering a new client name and
place on subform 1 the information on subform 2 is linked to the last added
client.

Example:
subform 1 already has Brown - Amsterdam
Jones - Rotterdam
I enter Smith - London

then I go to subform 2 and enter visit date, to do. This information should
be linked to Smith - London.

Does this makes sense?
Any help more than welcome.

Chris
 
R

Roger Carlson

C

Chris

Hi Roger,

thank you for your answer.
I tried to adapt your sample but I get an error saying 'You entered an
expression that has invalid reference to the property Form/Report'.
Here's my code:

Private Sub Form_Current()
If IsNull(Forms!frmKlantNieuwWerf!frmKlantWerfLijst.Form!IDWerfgegevens)
= False Then
Me.RecordsetClone.FindFirst "[IDWerfgegevens] = " &
Forms!frmKlantNieuwWerf!frmKlantWerfLijst.Form!IDWerfgegevens
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
Forms!frmKlantNieuwWerf!subfrmActieNieuw.SetFocus
DoCmd.GoToRecord , , acNewRec

End If
End Sub

where frmKlantNieuwWerf is the master form, frmKlantWerfLijst is the 1st
subform (where I enter the new client name and place) and subfrmActieNieuw
is the 2nd subform where I would enter the new sales talk info.
Linked fields between main form and subform 1 are: klantnr (on master form)
and werfKlantnr (on subfrm 1). On subfrm 2 there is idWerf that is the
'link' to get the sales talk connected to the client name and place. In my
relations idWerf (in tblActie) is related to IDWerfgegevens (in tblWerf).

Any suggestions?

Thanks,
Chris
 

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

Similar Threads


Top