I have a field on my data entry form called NAME. I also have a field on an attached subform called NAME. If a name is entered on the data entry form that matches a name on the subform I display a message. The VBA for the button is as followed
Code:
If Me.[FRMMODBUILDSUB].Form.NAME = Me.NAME Then
MsgBox "THAT NAME ALREADY EXISTS"
Else
DoCmd.OpenForm "LOGIN DIALOG", acNormal
DoCmd.Close acForm, "FRMMODBUILD", acSaveYes
End If
End Sub