Filtering problem

M

MrMMM

I have two issues with filtering on my form:
1) I have several fields that are disabled (greyed out) by using
conditional fomratting untill the value of another field is set to
equal to "Done". When I go into "Filter by form", these fields are
greyed out, and are not enabled even if I set the main field to "Done".

Is there a work around for this situation??

2) Is there a way to filter for NULLs in drop down boxes? Whenever I
type anything that is not on the dropdown list while trying to filter,
it tells me that the value is not in the list. Am I doing something
wrong here?

Thank you.
 
K

kingston via AccessMonster.com

Rather than using conditional formatting to disable the control, use the
form's OnCurrent event to lock the control. Use conditional formatting to
change only the format of the cell (provide a visual cue without affecting
function).

What do are you trying to do in part 2? Are you using the filter by form
function? There should be an Is Null selection available (where applicable).
 
M

MrMMM

Thanks, the OnCurrent seems to work just fine.
As far as filtering (Q#2) I have a drop down list with 2 options
"Succefull" and "Unsucsessful". There is no option for NULL. However,
by default the field is NULL (until something is selected). I want to
filter all records to see where nothing has been selected (the dropdown
was left NULL). When using filter by form, there is no option for is
null, and if I type it in, it says that the value I typed is not in the
list.

thank you.
 
K

kingston via AccessMonster.com

When you do a Filter By Form, use this in the combobox and apply the filter:
Is Null
 
M

MrMMM

I guess I spoke too soon. After I changed the format of my
"conditional" textboxes to be dependent through form's OnCurrent event,
they do not seem to be available whenever I changed the main control.
Only after I close and reopen the form, do the become available. Is
there any way to force the form to see that the combo has changed?
 
K

kingston via AccessMonster.com

I'm not sure my previous explanation was clear. The conditional formatting
should be applied no matter what; it's purely dependent on the data and has
nothing to do with the OnCurrent event. The OnCurrent event simply looks at
the data and sets the control's Locked property to True or False so that you
control whether the user can change data.
If after a record has been loaded, you are changing data that should unlock
the controls, you'll have to add a procedure to do so. IOW, OnCurrent may
lock a control based on existing data. If you change that data, you'll need
to unlock the control (probably using the combobox's AfterUpdate event).
 
M

MrMMM

Well, Idid try to use the "after update" of the combobox, but then I am
back to the problem of not being able to filter on these "locked"
boxes. Since in the FilterByForm view, i don't think it takes into
account this event.
So the idea is:
I have one main box called STATUS. when status is in process, I want
all the other boxes to be locked. when status is changed to finish, I
want the other boxes to become immideatly available. But I also want to
be able to use FilterByForm to filter in these other boxes.

Thanks.
 
M

MrMMM

Can I leave the locking part as form's on current, and on the main
combobox AfterUpdate event put Me.Requery? Are there any downsides to
doing it this way?
 
K

kingston via AccessMonster.com

Locking a control should still allow filtering via the Filter By Form menu
option; enabling or disabling a control is something different. I guess I
don't understand what you are trying to do. In any case, if Me.Requery works
as you intend, I would use it.
 
M

MrMMM

Requery didn't work, but you just pointed out my stupidity. I was using
me.enabled instead of me.locked. I wanted the fields to be visibly
grayed out. That's why I was using Enabled and that's what made
filterby form impossible.
 

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