+ Reply to Thread
Results 1 to 1 of 1

Thread: Formula with Conditions in Table

  1. #1
    Registered User
    Join Date
    04-13-2009
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    94

    Formula with Conditions in Table

    please help. im trying to make a form "see attached file" and i dont know which part of the formula is faulty. please refine my codes. thanks


    codes i did below.


    Option Compare Database.
    btw " l " = letter " L "

    Private Sub Command17_Click()
        Dim l1 As Long, l2 As Long, l3 As Long, l4 As Long, l5 As Long
            l1 = Text1 * Text2
            l2 = Text3 * Text4
            l3 = Text5 * Text6
            l4 = Text7 * Text8
            l5 = Text9
        If l1 = 0 Then
            Me.Text10.Value = (l2 + l3 + l4) / l5
                End If
        If l2 = 0 Then
            Me.Text10.Value = (l1 + l3 + l4) / l5
                End If
        If l3 = 0 Then
            Me.Text10.Value = (l1 + l2 + l4) / l5
                End If
        If l4 = 0 Then
            Me.Text10.Value = (l1 + l2 + l3) / l5
                End If
        If l5 > 0 Then
            Me.Text10.Value = (l1 + l2 + l3 + l4) / l5
                End If 
    End Sub
    
    Private Sub Command18_Click()
        Me.Text1.Value = ""
        Me.Text2.Value = ""
        Me.Text3.Value = ""
        Me.Text4.Value = ""
        Me.Text5.Value = ""
        Me.Text6.Value = ""
        Me.Text7.Value = ""
        Me.Text8.Value = ""
        Me.Text9.Value = ""
        Me.Text10.Value = ""
        
        
    End Sub
    
    Private Sub Command19_Click()
        DoCmd.Close
        
    End Sub
    Attached Files Attached Files
    Last edited by macky1730; 09-30-2010 at 05:20 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0