I've made up the code below because I don't actually know how to code this button, can you let me know how the Ifs should work please. At the moment nothing happens at all!
Thank you.
Code:
Private Sub Command27_Click()
If [sfrm_Company_Division_Register].[Company_classification].IsNull Then
MsgBox "Company must contain at least one division entry"
Resume ExitPoint
ElseIf CurrentProject.AllForms("Company_Selection_Form").IsLoaded Then
Forms![Company_Selection_Form].Refresh
DoCmd.Close acForm, Me.Name
Else: DoCmd.Close acForm, Me.Name
End If
ExitPoint:
On Error GoTo 0
Exit Sub
ErrTrap:
MsgBox Err.Number & " - " & Err.Description
Resume ExitPoint
End Sub
Thank you.