I am having trouble setting the focus on my form after a test for correct information. Is what I have so far:
Dim varX
varX = DLookup("[PersonAssigned]", "Passwords", "[Password] = Forms![Label-Creation]![Password]")
If IsNull(varX) Then
MsgBox "The password you entered is not valid for this operation"
Me!Password = ""
Me!Creator = ""
Me!Password.SetFocus
Else
Me.Creator = varX
Me.Creator.Requery
End If
It is suppose to go lookup the person assigned that the password entered and validate if they are able to this operation. It does everything except if it fails the test it goes to the next field on the form rather than back to the password text box.