Private Sub Command6_Click()
If DCount("[StaffName]", "qryppe", "[StaffName]=' " & Forms("MainForm").Staffname & "'") > 0 Then Exit Sub
DoCmd.OpenForm "frmppe", acNormal
End Sub
I used your code but have come to a problem, no matter which name is typed into the text box on the form the frmppe...