Please Help!
Can someone help me look at the code displed below? Something is terribly wrong with the code. I am tring to manupulate date through code but I can´t get it work.
On the code below I intend to read a Table value from a table called Login.
I have a logon form not bound to any table,but intended to grab username and password value and compare it with the value in the table Login.
If every thing goes well the select statement will open menu base on the value. You can send me an Email at
admin@makaiit.net
Thanks for your help.
--------------------------------here is the code
'Dim MyDB As DAO.Database
'Dim rs As DAO.Recordset
'Dim txtUsername As String
'Dim txtPassword As String
'Dim Departments As String
'Set MyDB = CurrentDb()
'Set rs = MyDB.OpenRecordset("Select * FROM Login", dbOpenSnapShot)
'If Not rs.EOF Then
'txtUsername.SetFocus
'rs("UserName") = txtUsername.Text
'If txtPassword.Visible = True Then
'txtPassword.SetFocus
'rs("Password") = txtPassword.Text
'Select Case Departments
'Case Reception
'txtUsername.SetFocus
'If rs("Username").Value = txtUsername.Text And _
' rs("password").Value = txtPassword.Text Then
'DoCmd.OpenForm "Reception Menu"
'End If
'Case Manager:
'If rs.Fields([UserName]) = txtUsername.Text And _
' rs.Fields([Password]) = txtPassword.Text Then
'DoCmd.OpenForm "administrative Menu"
'End If
'Case Restaurant:
'If rs.Fields([UserName]) = txtUsername.Text And _
' rs.Fields([Password]) = txtPassword.Text Then
'DoCmd.OpenForm "Restaurant Menu"
'End If
'Case Bar:
'If rs.Fields([UserName]) = txtUsername.Text And _
' rs.Fields([Password]) = txtPassword.Text Then
'DoCmd.OpenForm "Bar Menu"
'End If
'Case Else
'If rs.Fields([UserName]) = txtUsername.Text And _
' rs.Fields([Password]) = txtPassword.Text Then
'DoCmd.OpenForm "Bill Menu"
'End If
'End Select
Matthew Ikechukwu
Email:
admin@makaiit.net