View Full Version : Display Different Label When Filtering By Form


LQ
06-22-2001, 08:40 AM
I *think* this is possible, I just can't quite figure out how it should be done and where the coding should be put...

I have a form that users search via filter by form. In fact, the form opens in Filter by Form view. Don't ask me how, but users often get confused about whether they are in filter or are in the actual form itself. I would like there to be some sort of label that is only visible when they are in filter by form that says something like "Search the form." Aside from the form opening in Filter by Form, btw, I also have a "search" button on the form that allows them to use Filter by Form.

Thanks in advance for any suggestions!

dhoffman
06-22-2001, 09:21 AM
I'm curious what the function call is for putting the form in filter by form mode. I always just let the users hit the button at the top, on the menu bar. As for your question I'm not sure, is there some way to check if a form is in filter mode or not? Do any events function when the form is in filter by form mode? Ah, holy shit, pardon my French, I just learned how to tell if your form is in filterbyform or not.
do:
If Me.ServerFilterByForm Then
SomeLabel.Visible = True
Else
SomeLable.Visible = False
EndIF

I don't actually know if you can control labels and other objects on a form in FIlterbyForm mode but why not?

dhoffman
06-22-2001, 09:22 AM
Probably put the code in the OnCurrent property, but I'm not %100 on that.

dhoffman
06-22-2001, 09:26 AM
Wait a second, I may have gotten a little too excited there. The ServerFIlterBYForm property may not be exactly what you are looking for, but as far as I can determine there is no plain old FilterByForm property to check. Let me try and look into it a little more.

LQ
06-22-2001, 09:45 AM
Thanks...I will be waiting patiently for any inspirations that occur to you.

I don't know if it helps to know this, but the way I have the form opening up in Filter mode is to have

DoCmd.RunCommand acCmdFilterByForm

In the Form Open event. And then I have this

Beep
MsgBox "Remember to click on the Filter button after you enter your search criteria"
DoCmd.RunCommand acCmdFilterByForm
DoCmd.RunCommand acCmdClearGrid

In the command button's On Click event. (you would think that if I have a msgbox reminding users that they are filtering that this wouldn't be a problem, but it is!)

Thanks again for your input!