A
Afrosheen via AccessMonster.com
I can't understand it. For some reason this code gives me the Access Screen
of Death and I can't figure out why. When ever I do a backup and the program
restarts Access crashes. This is the code I've nailed it down to this. I
thought it was correct. Access crashes even if I don't press the update key.
Private Sub cmdUpdate_Click()
Dim myName As DAO.Recordset
10 On Error GoTo cmdUpdate_Click_Error
20 Set myName = Me.Recordset.Clone
30 myName.FindFirst "[user] = '" & Me!txtUserName & "'"
40 If myName.NoMatch Then
50 Me.txtUserName = ""
60 Me.txtUserName.SetFocus
70 DoCmd.OpenForm "frmWrong"
80 numCount = 1
90 End If
100 Me.Bookmark = myName.Bookmark
110 Me.[Password] = Text25
120 Call MsgBox("Password change has been confirmed." _
& vbCrLf & "It will be Activated the next time you Log In." _
& vbCrLf & "Until then use your current password." _
, vbInformation, Application.Name)
130 Me.Text25 = ""
140 Me.txtUserName = Null
150 Me.txtPassword = Null
160 Me.txtUserName.SetFocus
170 cmdpword.Enabled = False
180 Me.FormFooter.Visible = False
190 DoCmd.RunCommand acCmdSizeToFitForm
200 'End If
myName.Close
Set myName = Nothing
210 On Error GoTo 0
220 Exit Sub
cmdUpdate_Click_Error:
230 MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
procedure cmdUpdate_Click of VBA Document Form_frmLogin"
End Sub
What it is supposed to do is to update a persons password and it does do this.
I want to do is search for the person that matches the [user] that = the
txtUserName.
Thanks for looking at this.
of Death and I can't figure out why. When ever I do a backup and the program
restarts Access crashes. This is the code I've nailed it down to this. I
thought it was correct. Access crashes even if I don't press the update key.
Private Sub cmdUpdate_Click()
Dim myName As DAO.Recordset
10 On Error GoTo cmdUpdate_Click_Error
20 Set myName = Me.Recordset.Clone
30 myName.FindFirst "[user] = '" & Me!txtUserName & "'"
40 If myName.NoMatch Then
50 Me.txtUserName = ""
60 Me.txtUserName.SetFocus
70 DoCmd.OpenForm "frmWrong"
80 numCount = 1
90 End If
100 Me.Bookmark = myName.Bookmark
110 Me.[Password] = Text25
120 Call MsgBox("Password change has been confirmed." _
& vbCrLf & "It will be Activated the next time you Log In." _
& vbCrLf & "Until then use your current password." _
, vbInformation, Application.Name)
130 Me.Text25 = ""
140 Me.txtUserName = Null
150 Me.txtPassword = Null
160 Me.txtUserName.SetFocus
170 cmdpword.Enabled = False
180 Me.FormFooter.Visible = False
190 DoCmd.RunCommand acCmdSizeToFitForm
200 'End If
myName.Close
Set myName = Nothing
210 On Error GoTo 0
220 Exit Sub
cmdUpdate_Click_Error:
230 MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
procedure cmdUpdate_Click of VBA Document Form_frmLogin"
End Sub
What it is supposed to do is to update a persons password and it does do this.
I want to do is search for the person that matches the [user] that = the
txtUserName.
Thanks for looking at this.