[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Passing Variant to Function (for my "Audit"

Posted on 2013-01-20
2
Medium Priority
?
398 Views
Last Modified: 2013-01-20
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
Comment
Question by:Patrick O'Dea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
esolve earned 1500 total points
ID: 38798423
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
 

Author Closing Comment

by:Patrick O'Dea
ID: 38798804
to be re-visited!

Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question