IsNull and Len not working

  • Thread starter bhipwell via AccessMonster.com
  • Start date
B

bhipwell via AccessMonster.com

This is driving me nuts...

I have a number of combo boxes on a form. I would like the user to click a
button to determine if there are any combo boxes which need to be completed,
are completed. For the on click event I have used...

If IsNull(me.combo1) then

But when the combo box is empty, this code doesn't work. So, I figured there
must be a zero value string in there and I tried...

If Len(me.combo1 & "") = 0 then

and tried...

If Len(me.combo1) = 0 then

But same thing, the code passes right by the combo field. Help! Some of the
code works for some of the combo boxes in the code using IsNull. But for
others combo boxes the code is checking, it is not. Thoughts!?

BH
 
J

Jeff Boyce

You mention a "click event" ... clicking what?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jeff Boyce

We aren't there. We can't see your button.

Instead of forcing the user to click a button to see if s/he has filled in
everything, how about using the form's BeforeUpdate event to test to see if
values have been entered in every required control?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
B

bhipwell via AccessMonster.com

We need to have the functionality to check after the user has made there
updates.

The form has 10 drop down boxes. Not all of them require the user to select
an option. Therefore the user may make selections on 6 boxes and not the
remaining 4. The user then clicks button to see which combo boxes weren't
completed.

My issue is really more with the IsNull and Len functions not working. My
guess is they need to be coded differently than a regular text box, but I
don't know what I am missing.

BH
 
J

Jeff Boyce

When I'm trying to get some recalcitrant code to work, I set a breakpoint
and step through it line-by-line, inspecting the values.

You might be able to do something like this to see if what the actual values
of your tests are...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
C

Cheese_whiz

Hi bhipwell,

Does Len work with a number? If it doesn't, that might explain why you get
nothing from the Len function and nothing from the IsNull function. I'd
think Len would throw an error with a number, though.

Hard to guess without the rowsource of the combo...

/wild guess

CW

PS: You should consider what Jeff said about the beforeupdate event, imho.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top