T
Tatakau
Basically:
Shortly, I need a function that will return the number of items in the
variant array.
The Long Story:
I passed a number of arguments between two forms via a variant array (I
think). In Form1, the following code is run when the "Export" button is
clicked:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub cmdExport_Click()
MyArgs = Me!name & ";" & Me!address1 & " " & Me!address2 & ";" & Me!city
& ";" & Me!state & ";" & Me!zip & ";" & Me!phone & ";" & Me!email
DoCmd.Close acForm, Me.name
DoCmd.OpenForm "contacts", , , , , , MyArgs
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Basically, the MyArgs = "Name;Address;City;State;Zip;Phone;Email"
When Form2 is opened, it splits the arguments into an array (I think) with
the following code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Form_Open(Cancel As Integer)
Dim Args1 As Variant, args2 As Variant
If Not IsNull(Me.OpenArgs) Then
DoCmd.GoToRecord , , acNewRec
Args1 = Split(Me.OpenArgs, ";")
args2 = Split(Args1(0), " ")
..............
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All in all, Args1(0) = Name, Args1(1) = Address, Args1(2) = City, and so on.
Args2 is what concerns me though. The code parses Args1(0) by spaces and
puts it into Args2 without a hitch. The problem is that the length of Args2
is variable, and I need to put the values into different fields depending on
what format the name is in. For example, the name could be "George
Washington" or "Terry Tate Jr" or "Sam and Sue Smith".
Simply put, I need a function that will return the number of items in the
variant array. I did a good deal of searching, and I couldn't find one. The
Len() function came close though.
Thanks,
Nick
Shortly, I need a function that will return the number of items in the
variant array.
The Long Story:
I passed a number of arguments between two forms via a variant array (I
think). In Form1, the following code is run when the "Export" button is
clicked:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub cmdExport_Click()
MyArgs = Me!name & ";" & Me!address1 & " " & Me!address2 & ";" & Me!city
& ";" & Me!state & ";" & Me!zip & ";" & Me!phone & ";" & Me!email
DoCmd.Close acForm, Me.name
DoCmd.OpenForm "contacts", , , , , , MyArgs
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Basically, the MyArgs = "Name;Address;City;State;Zip;Phone;Email"
When Form2 is opened, it splits the arguments into an array (I think) with
the following code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Form_Open(Cancel As Integer)
Dim Args1 As Variant, args2 As Variant
If Not IsNull(Me.OpenArgs) Then
DoCmd.GoToRecord , , acNewRec
Args1 = Split(Me.OpenArgs, ";")
args2 = Split(Args1(0), " ")
..............
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All in all, Args1(0) = Name, Args1(1) = Address, Args1(2) = City, and so on.
Args2 is what concerns me though. The code parses Args1(0) by spaces and
puts it into Args2 without a hitch. The problem is that the length of Args2
is variable, and I need to put the values into different fields depending on
what format the name is in. For example, the name could be "George
Washington" or "Terry Tate Jr" or "Sam and Sue Smith".
Simply put, I need a function that will return the number of items in the
variant array. I did a good deal of searching, and I couldn't find one. The
Len() function came close though.
Thanks,
Nick