UDT

  • Thread starter Thread starter JonWayn
  • Start date Start date
J

JonWayn

Is there a built-in VB function that reinitializes the elements of a
user-defined type variable?
 
No, but you can declare two variables, one of which is always empty, and set
the "full" one to the empty one:

Dim udtCustomer As Customer
Dim udtEmptyCustomer As Customer

Set udtCustomer = udtEmptyCustomer

Long as you haven't used udtEmptyCustomer for anything, it'll be empty. Note
that if your UDTs are very large, this can take up some resources, in which
case you'd be better off writing a simple routine that would assing
vbNullString, 0, etc etc to the appropriate members.
 
Thank you. That's cool.


Scott McDaniel said:
No, but you can declare two variables, one of which is always empty, and set
the "full" one to the empty one:

Dim udtCustomer As Customer
Dim udtEmptyCustomer As Customer

Set udtCustomer = udtEmptyCustomer

Long as you haven't used udtEmptyCustomer for anything, it'll be empty. Note
that if your UDTs are very large, this can take up some resources, in which
case you'd be better off writing a simple routine that would assing
vbNullString, 0, etc etc to the appropriate members.
 
Back
Top