Well, this is the code for sfrm_notitieLijst code module:
Code:
Option Compare Database
Option Explicit
Private Sub Bijschrift11_Click()
With Me.Parent
If IsNull(.Id) Then
MsgBox "Please select a prospect.", vbInformation, Me.Caption
.cboZoekProspect.SetFocus
Else
DoCmd.OpenForm "sfrm_notitieNieuw", acNormal, , , acFormAdd, acDialog, .Id
Me.Requery
End If
End With
End Sub
This is the code for sfrm_notitieNieuw code module:
Code:
Option Compare Database
Option Explicit
Private Sub btn_close_Click()
DoCmd.Close acForm, Me.Name
End Sub
Private Sub Form_Load()
If IsNull(Me.OpenArgs) Then
'There is no relatie for note.
Else
Me.id_klant = Me.OpenArgs
Me.cmb_contact.Requery
End If
End Sub
This is the Control Source for the the Textbox cmb_relatie in sfrm_notitieNieuw:
Code:
=DLookUp("r_naam";"tbl_relatie";"IdRelatie=" & [id_klant])
This is the Row Source of cmb_contact in sfrm_notitieNieuw:
Code:
SELECT tbl_contact.IdContact, tbl_contact.c_rel_id, tbl_contact.c_naam & " " & tbl_contact.c_voornaam AS Expr1
FROM tbl_contact
WHERE (((tbl_contact.c_rel_id)=[forms]![sfrm_notitieNieuw]![id_klant]))
ORDER BY tbl_contact.c_naam & " " & tbl_contact.c_voornaam;
Let me know if it works as you expected.
Cheers,
John