Hide specific detail columns using VB/VBA

SOLVED

I'm creating a customized OE Entry screen. I want all the users to have the exact same fields and detail columns. I'm able to hide fields on the header level using the code below. But I'm not sure how to hide specific detail columns. Anyone know how to do this?

Private Sub AccpacOE1100UICtrl1_OnUIAppOpened()
     'HIDE HISTORY BUTTON
     AccpacOE1100UICtrl1.UIAppControls("APP_History_Button").MacroVisibleFlag = False
End Sub

  • +1
    verified answer

    You're looking for the AccpacGrid control. Once you have that, there are options for accessing the properties of individual columns.  Here's a small sample that I have for locking down some columns in the taxes grid on the Order Entry screen:

        'TAX GRID
        Dim avlTaxes As AccpacGrid
        Dim i As Integer
        Set avlTaxes = AccpacUI.object.UIAppControls("agdOEORDHtax4").GetControl
        For i = 0 To avlTaxes.ColumnCount - 1
            Debug.Print CStr(i) & ":" & avlTaxes.GetColumnName(i)
        Next i
        avlTaxes.SetEditable 4, False