I've defined a user-defined data type as per the online help example: <br>
<br>
Type EmployeeRecord ' Create user-defined type.<br>
ID As Integer ' Define elements of data type.<br>
Name As String * 20<br>
Address As String * 30<br>
Phone As Long<br>
HireDate As Date<br>
End Type<br>
<br>
and declared a variable: <br>
<br>
<br>
Dim MyRecord As EmployeeRecord<br>
<br>
Now I want to map the entire structure to a string variable (the string variable is required by a subsequent function)<br>
<br>
Dim Somestring as String<br>
<br>
This statement: <br>
<br>
Somestring = MyRecord <br>
<br>
Yields (as one would expect) a run-time type mismatch error. Is there a method of coding this to avoid such an error? <br>
<br>
Thanks. <br>
<br>
<br>
Type EmployeeRecord ' Create user-defined type.<br>
ID As Integer ' Define elements of data type.<br>
Name As String * 20<br>
Address As String * 30<br>
Phone As Long<br>
HireDate As Date<br>
End Type<br>
<br>
and declared a variable: <br>
<br>
<br>
Dim MyRecord As EmployeeRecord<br>
<br>
Now I want to map the entire structure to a string variable (the string variable is required by a subsequent function)<br>
<br>
Dim Somestring as String<br>
<br>
This statement: <br>
<br>
Somestring = MyRecord <br>
<br>
Yields (as one would expect) a run-time type mismatch error. Is there a method of coding this to avoid such an error? <br>
<br>
Thanks. <br>
<br>