If you look at my question "determining if users Password is blank or
standard" posted 8/6/2009 6:54 PM PST, I was told to try On Error Resume Next
to trap this error. This fixed the code from Joan Wild but now I am trying
to get users to change their default password I have assigned through code
and can't seem to determine when their password is "MARINES"
Thank you for your response. Hope you can help me.
"AccessVandal via AccessMonster.com" wrote:
> I don't see that you have any error trapping on. Judging from this, I don't
> think this error comes from the form' open event.
>
> What's with the "On Error Resume Next" for ignoring errors?
>
> Martin wrote:
> >I have the below code that checks to see if a user has a blank password.
> >That section works. My problem is the else loop. No matter what password I
> >set for myself, I still get error 3029. My default password is "MARINES" and
> >I want to force users to change their default password.
> >
> >My question is can I do it through code?
> >
> >Thank you for your time and help.
> >
> >Private Sub Form_Open(Cancel As Integer)
> >
> >Dim ws As Workspace
> >Dim myset As Recordset
> >Dim db As Database
> >Dim iPerm As Integer
> >Dim iStud As Integer
> >
> >On Error Resume Next
> >
> >Set ws = DBEngine.CreateWorkspace("tempws", CurrentUser(), "")
> >Debug.Print CurrentUser()
> >Debug.Print err.number
> >If err = 0 Then
> > MsgBox "Your PASSWORD is blank. This will not be tolerated! Your
> >access to the dbase will be TERMINATED if not fixed NOW.", vbCritical
> > 'users has a blank password
> > Set db = CurrentDb
> > Set myset = db.OpenRecordset("tblUsers", dbOpenTable)
> > myset.Index = "UserName"
> > myset.Seek "=", CurrentUser()
> > If myset.NoMatch Then
> > 'Stop No matching record
> > MsgBox "No Matching UserName record", vbCritical
> > Else
> > 'Stop found matching record
> > Debug.Print myset!UserName
> > myset.Edit
> > myset!BLANKPASSWORD = -1
> > myset.Update
> > End If
> >Else
> >' Stop
> > 'users password is not blank
> > 'check to see if it is still the default
> > Set ws = DBEngine.CreateWorkspace("tempws", CurrentUser(), "MARINES")
> > Debug.Print err.number, err.Description 'error = 3029 Not a valid
> >account name or password.
> > If err = 0 Then
> > 'Stop 'user PASSWORD is still default
> > MsgBox "Your PASSWORD is still the default. Please change your
> >password or you will loose your access to the company dbase. Don't know how.
> > Call 8582 and talk to Mr. Cox.", vbCritical
> > Else
> > 'Stop 'user has changed their password
> > MsgBox "Thank you for changing your PASSWORD. ", vbCritical
> > End If
> >End If
>
> --
> Please Rate the posting if helps you.
>
> Message posted via http://www.accessmonster.com
>
>