Wierd Problem

helloworld

Registered User.
Local time
Today, 08:18
Joined
May 18, 2004
Messages
62
Hi there,

I have some code for generating reports that involve an IsNull Statement.

I have 2 comboboxes that are in a if statement. The code should execute if Combo1 is not null and Combo2 is Null.But the wierd part is the code fluctuates.

Sometimes it works when I have

If (IsNull(Me!Combo1) = False) and (IsNull(Me!Combo2) = true) then....

and sometimes it gives me an error message saying that the system could not find 'Forms'. However, if I alter the code to say


If (IsNull(Me!Combo1) = False) and (Me!Combo2 = "") then.....

the code works and then after sometime gives me the same error message.


Can someone please help me?
 
hello hello,

I think they're initiall Null, then after being used (and cleared), they are
an empty string.

You might try:

If Nz(Me.Combo1) <> "" And Nz(Me.Combo2) = "" Then ...

Wayne
 
Hi Wayne,

Thanks for your reply. However, that does not seem to fix the problem as I keep getting the same Error Message.
 
Alright...I have managed to narrow the problem down to one event. I get this error only when I leave the database idle for more than a couple of mins. Could there be a reason for this?
 
hello,

Not that I know of.

Have you tried running it with the debugger to see if the combos have
values, empty strings, or Nulls?

Wayne
 

Users who are viewing this thread

Back
Top Bottom