I have a
- mainform called: [frm_traject_details]
- a page on the mainform called: [page_status - resultaat]
- a subformelement (for displaying subform) called: [Redenen van winst of verlies]
- a subform called frm_reden
- a combobox on the subform called: cmb_reden_cat
When a certain criteria is not met, i want to show a message and set the focus to a field on the subform.
On the page i have a field in which, in the BeforeUpdate procedure, i have;
Expand|Select|Wrap|Line Numbers
- Private Sub Form_beforeupdate(Cancel As Integer)
- DoCmd.Echo True
- Dim ctl As Control
- If Me![Status Res] <> 5 And Me![Soort traject] < 6 And Me![chk_reden] = False Then
- MsgBox ("Het resultaat van dit traject is " & [Status Res].Column(1) & ", geef aan wat de reden(en) hiervoor zijn aub!")
- Me.[Redenen van winst of verlies].SetFocus
- Me.[frm_redenen].SetFocus
- Me.[Redenen van winst of verlies]!cmb_reden_cat.SetFocus
- Cancel = True
- Exit Sub
- End If
Any suggestions ?
Thanks,
Pierkes