Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing User Defined Types

Status
Not open for further replies.

MissyEd

IS-IT--Management
Feb 14, 2000
303
GB
Hi all

I have a class that manages a table. It gets information from the table in the form of properties and sets various status's in the form of methods.

Using the class, I am able to edit, delete, check for specific entries in the table. To add records however, I decided to use a user defined type, especially as I need to add in 2 ways. 1 - after the user has selected the items from a form, 2 - When an action is taken in the program, the program then adds a record to the table.

The main problem Im having with my UDT is nullifying the date fields. I originally set it as a global variable since i could not pass it as a parameter. However, since I cant nullify the dates, the data being written to the table is inaccurate, bearing the date of the previous addition. Is there a way to initialise UDT's or a better way to pass these variables. Bearing in mind, there are about 20 fields. I realise I could make the date fields into variants, but would prefer a less memory hogging method.

Any help gratefully accepted.

Thanks! Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com
 
Using a variant is really the best way. For simple data types, a variant doesn't really add any appreciable overhead, either in storage or in execution time. Especially if you only have one copy of the UDT, in a global variable, the variant overhead is negligible.

Why do you think variants are memory hogs? Rick Sprague
 
Guess I was always told they were a No-No, my boss hates them, but if thats the only way, then he'll have to live with it!

Thanks a lot Rick Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top