I haven’t used the OpenArgs property in Microsoft Access for ages.
However, today I needed to pass a variable number of values from a form to another form.
In doing so I needed to seperate out each value passed in the OpenArgs property of the calling form which have been seperated using the | character (accessed using shift + \ on my UK keyboard).
So how did I do it?
Here’s the code:
Dim Hold_OpenArgValues() as String
Hold_OpenArgValues()=Split(Me.OpenArgs, "|")
We can then do something with the values returned to the array.
As an example we could write them to the Immediate window using the UBound function to decide how many items have been passed (this was going to be variable remember).
For counter = 0 to UBound(Hold_OpenArgValues)
Debug.Print "Value " & counter, Hold_OpenArgValues(counter)
Next counter
What you’ve done is just great!!! Very useful
Very nice!!
Thanks so much! Just what I needed.