Hello,
Forum
I would like to use the inventory 2007 template and add a login form.
The Employees will filter the form Inventory Transactions List based on their Category.
How can I go about doing it?
Code:
Option Compare DatabaseOption Explicit
Private Sub btnLogin_Click()
'Assigning Variables
Dim strcboPass As String
Dim strPassword As String
Dim strCategory As String
'Setting Variables based on condition in cbobox
strcboPass = Me.cboUsername.Column(2)
strPassword = Nz(Me.txtPassword, " ")
strCategory = Me.cboUsername.Column(3)
'Evaluate Expression whether the user is true
If strPassword = strcboPass Then
'Grouping them in their respective sections
Select Case strCategory
Case "Radio"
DoCmd.OpenForm "Inventory Transactions List", acNormal, Category = Radio, , , acWindowNormal
DoCmd.Close acForm, "frmLogin"
End Select
Else
MsgBox "Login UnSuccessful!"
Me.txtPassword = Null
Exit Sub
End If
End Sub
TIA
Haziq