Database all over the shop!

homer5677

New member
Local time
Yesterday, 17:45
Joined
Sep 1, 2013
Messages
2
Hello,
I'm quite new here, and am in a bit of a bother.
I'm currently trying to model a bank database and i am a bit stuck with linking the balances in an accounts table to transactions and updating. I'm am also unsure how i can best use what i have for what i need. I have a login working correctly but before i add links to different forms i need to make sure its working as it should and updating etc.
Any help would be much appreciated.
Thanks
 

Attachments

Thanks that helped out a bit.
I was just fiddling with the login, is there like a specifc cmd i can code so that the form only displays data from whoever is logging in. My code;
Code:
Private Sub cmdlogin_Click()

Dim dbs As Database
Dim rstUserPwd As Recordset
Dim CustMatch As Boolean
Dim EmployMatch As Boolean
Dim AdminMatch As Boolean
Dim rstCustPwd As Recordset
Set dbs = CurrentDb
Dim loadInfo As Recordset

Set rstUserPwd = dbs.OpenRecordset("qryEmplyLogin")
Set rstCustPwd = dbs.OpenRecordset("qryCustLogin")
Set loadInfo = dbs.OpenRecordset("VIEW ALL")
CustMatch = False
EmployMatch = False
AdminMatch = False



If rstUserPwd.RecordCount > 0 Then
    rstUserPwd.MoveFirst
    
    'check for matching records
    Do While rstUserPwd.EOF = False
    If rstUserPwd![LoginName] = Form_frmLogin.txtusername.Value And rstUserPwd![Login Password] = Form_frmLogin.txtpassword.Value And rstUserPwd![Admin] = True Then
    AdminMatch = True
    Form_frmLogin.cmdlogin.SetFocus
        Exit Do
    ElseIf rstUserPwd![LoginName] = Form_frmLogin.txtusername.Value And rstUserPwd![Login Password] = Form_frmLogin.txtpassword.Value Then
    EmployMatch = True
    Form_frmLogin.cmdlogin.SetFocus
        Exit Do
    End If
        rstUserPwd.MoveNext
    Loop
End If


If rstCustPwd.RecordCount > 0 Then
    rstCustPwd.MoveFirst
Do While rstCustPwd.EOF = False
    If rstCustPwd![Login Name] = Form_frmLogin.txtusername.Value And rstCustPwd![Internet Banking Password] = Form_frmLogin.txtpassword.Value Then
    CustMatch = True
    Form_frmLogin.cmdlogin.SetFocus
    Form_frmCustHome.lblcustname.Caption = loadInfo![Customer Full Name][COLOR="Yellow"]Somewhere here. The above just adds whatever the first line of data is, how do i view the data that i have logged in with?[/COLOR]
Exit Do
End If
    rstCustPwd.MoveNext
    Loop
End If



If AdminMatch = True Then
'open the next form here and close this one
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "Interface_Admin"

ElseIf EmployMatch = True Then
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "Interface_Emplyee"
ElseIf CustMatch = True Then
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "Interface_Customer"
Else
MsgBox "Incorrect Username or Password. Please Retry.", , "Login"
Form_frmLogin.txtpassword.SetFocus

End If

End Sub

Private Sub Detail_Click()

End Sub

Private Sub Form_Current()

End Sub
 

Users who are viewing this thread

Back
Top Bottom