View Single Post
  #10  
Old May 15th, 2004, 08:11 PM
Steve
external usenet poster
 
Posts: n/a
Default Form Doesn't Go To New Record

I just downloaded the sample mdb! I really appreciate you doing that for me.

The code between class and /class goes in a new class module. By new
class module, do you mean a standard module?

Thanks for all the help you have given!

Steve



"rkc" wrote in message
...

"Steve" wrote in message
ink.net...


To try and learn something new and understand what you propose, I have

some
questions:
1. What is the advantage to what you propose?


The code for the textbox(s) behaviour is all in one place, in a
class module.

2. Where specifically does your code go?


The code between class and /class goes in a new class module.

3. Set and load all the textboxes you want to have the behaviour into

a
collection in the form's open event. How do you do this? There around

25
fields on the form, would you then cycle through the collection in the
BeforeUpdate event code?




4. There are a couple of memo fields, how are they handled?


Same as text fields


5. txtbox.Value = Replace(txtbox.Value, vbCrLf, " ") Why are you

replacing
a CrLf with a space rather than a null string?


Because you can end up with two words run together if you don't.

6. What causes Private Sub Class_Terminate() to execute?


The object you create from the class definition goes out of scope.
Actually all objects created in the class should be destroyed when
the class goes out of scope any way. Destroying them explicity is
just a habit.


I posted a sample .mdb at the following url. Let me know when/if you
download it so I can take it off line.

"http://www8.brinkster.com/rkc/pcDataSheet.mdb