Unlock takes me back to first subform record

M

Miranda

Here is my code.....

Private Sub cmdOK_Click()
Dim sPassword As String

sPassword = Nz(Me.txtPassword.Value, "")


' if it is a valid password, we let them edit the
' form that called this form. The calling form is
' responsible for check that the current user is
' either the QA tech on the record, or a member
' of the admins or full permissions group, this form
' only checks to see if the password they are entering
' to unlock that form is valid
If ufnIsValidUserNamePassword([Forms]![frmSupervisor]![txtUserName],
sPassword) Then
Forms!frmBol.AllowEdits = True
Forms!frmBol!sfrmData.Form.AllowEdits = True

DoCmd.Close acForm, Me.Name
Else
MsgBox "Unable to validate password, please verify it is typed
correctly!", vbExclamation
End If
End Sub

The problem is when I want to unlock form #5 but subform #3. When I
"unlock" the record it moves me back to form #5, subform #1. Then when I
move to subform #3 it locks because the locking code is in the on current
event. How can I correct this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top