I have a form where a production order can be stopped by the button "btn_StopOrdre". However certain conditions must bet met in order to do this.
First criteria - If no choice has been made in combo box "cbm_Medarbejder" a message box tells the operator to fill it out.
Second criteria - If the Query "qry_AfslutProduktionsordreMedarbejder" returns no rows another message box tells the operator that
the productions order is not started yet and therefore cant be stopped.
If both criteria is met, form "frm_ctn_TidStop" will open
I need a little help with the (if, else and exit sub) in the right sequence
Here is what I have so far:
First criteria - If no choice has been made in combo box "cbm_Medarbejder" a message box tells the operator to fill it out.
Second criteria - If the Query "qry_AfslutProduktionsordreMedarbejder" returns no rows another message box tells the operator that
the productions order is not started yet and therefore cant be stopped.
If both criteria is met, form "frm_ctn_TidStop" will open
I need a little help with the (if, else and exit sub) in the right sequence

Here is what I have so far:
Code:
Private Sub btn_StopOrdre_Click()
Dim intanswer As Integer
Dim inCnt As Integer
If IsNull(Forms!frm_ctn_List!cbm_Medarbejder) Then
intanswer = MsgBox("Husk... Vælg medarbejder fra dropdown list", vbOKOnly)
Forms!frm_ctn_List!cbm_Medarbejder.SetFocus
Else
DoCmd.OpenForm "frm_ctn_TidStop", , , "MedarbejderID=" & cbm_Medarbejder.Value & "and [off]= 0", acFormEdit, acWindowNormal
Forms![frm_ctn_TidStop].AllowAdditions = False
End If
intCnt = DCount("[No_]", "[qry_AfslutProduktionsordreMedarbejder]")
If intCnt = 0 Then
MsgBox "Du kan ikke afslutte en ordre du ikke har startet", 64, "Stop produktionsordre"
End If
End Sub