Hi Cris!
Surely, your application has plenty of room for development and optimization, but, for this moment...
add the proccedure below in the code module of the frm_fiche:
Code:
Public Sub AddSomething(ByVal strAddTo As String)
With Me
If IsNull(.Id) Then
MsgBox "Please select a prospect.", vbInformation, Me.Caption
.cboZoekProspect.SetFocus
Else
DoCmd.OpenForm strAddTo, acNormal, , , acFormAdd, acDialog, .Id
Me.Requery
End If
End With
End Sub
For the Click event of the Nieuwe contactpersoon "button" give this code:
Code:
Me.Parent.AddSomething "sfrm_contactnieuw"
of Nieuwe notitie give this:
Code:
Me.Parent.AddSomething "sfrm_notitieNieuw"
and for Nieuwe offerte this:
Code:
Me.Parent.AddSomething "sfrm_offerteNieuw"
As you can see, at the last three expressions, changing only the name of the form that you want to open.
From the pop-up forms side, you can use the passed prospect ID as folows:
For sfrm_contactnieuw:
Code:
Private Sub Form_Load()
Me.c_rel_id = CLng(Me.OpenArgs)
End Sub
and for sfrm_offerteNieuw:
Code:
Private Sub Form_Load()
Me.cmb_relatie = CLng(Me.OpenArgs)
End Sub
Cheers,
John