Solved

Passing Variant to Function (for my "Audit"

Posted on 2013-01-20
2
365 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
2 Comments
 
LVL 6

Accepted Solution

by:
esolve earned 500 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

810 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