Results 1 to 2 of 2
  1. #1
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124

    Editing Microsoft Access 2007 Inventory Template


    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
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Note the commas in the following:

    DoCmd.OpenForm "Inventory Transactions List", acNormal, , "Category ='Radio'", acWindowNormal
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Inventory 2007 Template
    By MdHaziq in forum Access
    Replies: 3
    Last Post: 01-15-2018, 10:51 PM
  2. Replies: 2
    Last Post: 01-15-2018, 07:46 PM
  3. Loading a Microsoft Word template from Access
    By fritesmodern in forum Programming
    Replies: 1
    Last Post: 10-20-2016, 07:53 PM
  4. Replies: 1
    Last Post: 02-24-2013, 04:42 AM
  5. Replies: 1
    Last Post: 09-02-2011, 07:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums