Re: Match User Name and Password from Access table

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This is first time for me, thank you for the tip. And thank you so much for
the fixing my code.

"Douglas J. Steele" wrote:

> Already answered in another newsgroup to which you posted the same question.
>
> If you feel you need to post to more than one group (HINT: it's seldom
> necessary), please have the courtesy to cross-post (send the one message to
> all groups at once), rather than multi-post (send individual messages to
> each group). In this way, all responses to your post will be available
> together, regardless of what group the responder was in, and the rest of us
> won't have to read your post multiple times. (It also uses fewer server
> resources)
>
> If you're using Microsoft's web interface to post, you should see an
> "Advanced Options" link at the bottom of the page. You can type the names of
> the various groups into the Newsgroup box, separating each newsgroup name
> with a semicolon.
>
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "GGill" <GGill@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:C454A840-54B6-40C9-93E5-E08F87E03E11@xxxxxxxxxxxxxxxx
> > Hi,
> > I have one table 'tblUsers' with UserNm and Password fields. In my
> > 'frmLogin' form i have 2 text boxes txtUserNm and txtPassword and button
> > 'Login'. So I am trying too on click 'Login' button write code, If string
> > UserName and Password match from tblUsers then open some new form for
> > example
> > 'frmNew', If not then msg box.
> > Here is my unfinished code, please make this code work. I think I have to
> > use rs.Match and rs.NotMatch or Look, but I don't know how, Please help
> > me
> > finish this code.
> > ----------------------------------
> > Private Sub cmdLogin_Click()
> > On Error GoTo Err_cmdLogin_Click
> >
> > Dim rs as recordset
> > Set rs = CurrentDB
> > Dim strUser as string
> > Dim strPassword as string
> >
> > txtUserNm.setfocus
> > strUser=txtUserNm
> > txtPassword.setfocus
> > strPassword=txtPassword
> >
> > If Not IsNull(me.txtUserNm) and Not IsNull(me.txtPassword) Then
> > set rs = CurrentDB.OpenRecordset("Select * from tbl Users where UserNm =
> > '"
> > & strUser & " And Password = '" & strPassword &, dbOpenSnapshot)
> >
> > If rs.EOF Then
> > Docmd.OpenForm "frmNew"
> > End If
> >
> > If Not rs.EOF then
> > MsgBox "In Correct"
> >
> > End If
> >
> > Exit_cmdLogin_Click:
> > Exit Sub
> >
> > Err_cmdLogin_Click:
> > MsgBox Err.Description
> > Resume Exit_cmdLogin_Click
> >
> > End Sub
> >
> >
> >
>
>
>
.



Relevant Pages

  • Re: Click Button added via VBA
    ... First time I tried it, ... soon as the CommandButton is loaded with the code...Word Crashes, ... Private Sub CommandButton1_Click ... Dim shp As Word.InlineShape ...
    (microsoft.public.office.developer.vba)
  • Re: Click Button added via VBA
    ... First time I tried it, ... soon as the CommandButton is loaded with the code...Word Crashes, ... Private Sub CommandButton1_Click ... Dim shp As Word.InlineShape ...
    (microsoft.public.office.developer.vba)
  • Re: Setting Table Property "Description" in Code
    ... > Dim dbCurr As DAO.Database ... > Dim tdfCurr As DAO.TableDef ... > Exit Sub ... > Doug Steele, Microsoft Access MVP ...
    (microsoft.public.access.modulesdaovba)
  • Method MailEnvelope of object _Worksheet failed
    ... The code below works once (the first time). ... Run-time error '-2147467259 ': ... Sub SendFile() ... Dim wkb1 As Workbook ...
    (microsoft.public.office.developer.vba)
  • Method MailEnvelope of object _Worksheet failed
    ... The code below works once (the first time). ... Run-time error '-2147467259 ': ... Sub SendFile() ... Dim wkb1 As Workbook ...
    (microsoft.public.outlook.program_vba)