Douglas said:
If the name of the class module is REDACTION, you need to use
Dim RA As REDACTION
I would advise very strongly against using the New keyword in your
declaration. Instead, in the procedure that's using it, put
Set RA = New REDACTION
immediate before
If RA.REDACT > "" Then
Pardon my bluntness, but I have to ask. Why are you using such a convoluted
approach? Having a class module doesn't buy you anything in this case.
Putting the function in a regular module, not bothering with the RA object
and just using
If REDACT() > "" Then
or, better,
If Len(REDACT()) > 0 Then
will accomplish the same results with far fewer headaches!
Bluntness not minded! The reason this is happening is this.
I have my application just about finished. I need to make a duplicate
copy of the database in another database on a transaction by transaction
basis. The first db is linked, and I cannot link the duplicate database
because I don't want to change my table names so I'm using this
method;however the user needs to be able to change th epath that the
duplicate database is located in on the fly. I'm trying to avoid using
DLookup on every transaction to get the path of the duplicate databse.
So I thought if I use a Class Module the Class Module would grab the
path for me when the form (One of Many) is opened. This way I could go
directly into the statement
If blah blah > "" Then
As opposed to...
Dlookup...
If blah blah > "" Then
I also thought of setting the value on form open to either a dim or a
textbox whic\h seems to work fine. I'm still learning this so I do
appreciate your help and most of all your patience.
I just want to get the string as easy as possible without having to do
much for each transaction. A Class Module sounds good, but maybe it
isn't, maybe there are downsides that I don't realise. Speed? Like I
said I'm still relatively new and self-taught as well as a lot of help
from the wonderful people at these newsgroups!
Thanks
DS