Results 1 to 8 of 8
  1. #1
    yamalady is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2013
    Location
    Ohio
    Posts
    17

    What is wrong with this formula?

    [Combined Dashboard Data]![CGrp] & [Combined DashboardData]![SCGrp] & "00000" & [Combined Dashboard Data]![ProgramType] & if(Len([Combined Dashboard Data]![Material)=10,"0",if(len( [Combined Dashboard Data]![Material])=9,"00","000")& [Combined Dashboard Data]![Ship From] & (if(Len([Combined DashboardData]![Ship From])=4,"-0000",[Combined Dashboard Data]![Ship From]))

    Access is telling me I have an Invalid bracketing of name
    [Combined Dashboard Data]![Material)=10,"0",if(len( [Combined Dashboard Data]![Material]

    Maybe I've been staring at it too long to see the problem. Please help!


  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    IIF(
    not if.

    (but I didnt check any more on bracketing)

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    also, if the formula gets too big like that , then make a custom function and use code to make it more readable.

  4. #4
    yamalady is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2013
    Location
    Ohio
    Posts
    17
    Oof...thanks....I've been excel too long. I changed that, but still didn't change the error.

  5. #5
    yamalady is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2013
    Location
    Ohio
    Posts
    17
    I am not that savvy. I don't know how to use code or to make a custom function.

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    [Combined Dashboard Data]![Material])=10,"0",if(len( [Combined Dashboard Data]![Material]


  7. #7
    yamalady is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2013
    Location
    Ohio
    Posts
    17
    Yes I believe I was staring at it too long!! That was it!!

  8. #8
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Code:
    Public Function calcFormula(pvGrp, pvType, pvMat, pvShip)
    Dim M, S
    Select Case pvMat
        Case 10
          M = "0"
        Case 9
          M = "00"
        Case Else
          M = "000"
    End Select
    
    If pvShip = 4 Then
      S = "-0000"
    Else
      S = pvShip
    End If
    
    
    calcFormula = pvGrp & "00000" & pvType & M & S
    End Function

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

Similar Threads

  1. what is wrong ?
    By dino in forum Access
    Replies: 19
    Last Post: 07-29-2015, 11:13 AM
  2. Replies: 19
    Last Post: 07-13-2015, 10:15 AM
  3. Replies: 41
    Last Post: 05-29-2015, 02:58 PM
  4. what is wrong
    By Dinoshop in forum Access
    Replies: 1
    Last Post: 07-11-2014, 06:22 AM
  5. What is wrong with this IFF?
    By bburton in forum Reports
    Replies: 2
    Last Post: 03-16-2011, 10:42 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