[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

Passing Variant to Function (for my "Audit"

Hi,

1. I am fine tuning my audit procedures on my forms.

2. e.g. "User: Joe changed StreetName from 'High Street' to 'Low Street' at 12:22 on Jan 12"

3. I have created a new function called "RecordAudit".  

Dim acontrolnames As Variant
    
    acontrolnames = Array("CustomerName", "Email", "WindowCount", "DateReported", "SiteVisitRequired" _
    , "CallOutCharge", "FaultyWindowCount")
            
    RecordAudit (acontrolnames)

Open in new window




4. From this code you can see that I call function RecordAudit.
5. For simplicity sake I wish to "msgbox CustomerName.OldValue"   and all the fields within the variant.

How do I display these fields.
(I guess I am unsure how to pass the variant and then process each field)
0
Patrick O'Dea
Asked:
Patrick O'Dea
1 Solution
 
esolveCommented:
Sub x()
    Dim vntArray As Variant
    Dim strBuf As String
    Dim intIndex As Integer
     
    vntArray = Array(10, 20, 30, 40, 50)
    For intIndex = LBound(vntArray) To UBound(vntArray)
        strBuf = strBuf & "Index " & intIndex & " = " & vntArray(intIndex) & vbLf
    Next
    MsgBox "My Array contains the following " & vbLf & strBuf, vbInformation
     
End Sub
0
 
Patrick O'DeaAuthor Commented:
to be re-visited!

Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now