Filter By Form

P

Paul Mars

Form can be opened with several different RecordSources as:

DoCmd.OpenForm "MainData"
Forms!MainData.RecordSource = "RecordsAddress"

DoCmd.OpenForm "MainData"
Forms!MainData.RecordSource = "RecordsAddressChildren"

DoCmd.OpenForm "MainData"
'default RecordSource is AllRecords

When click "Filter By Form" on toolbar, the dropdown choice for each Form
control displays all values from the original Form RecordSource
"AllRecords". Although, if a value is selected that does not exist in the
current recordSource, it will not display when "Apply Filter".

I need the dropdown choices to be limited to the current RecordSource. How
can I do this?

tks,
Paul
 
A

Allen Browne

Paul, I think your abilities have outgrown the usefulness of the
Filter-By-Form (FBF) interface.

There are several issues with FBF, such as the one you hightlight. A more
severe one is that it does not work with an MDE file. That means FBF is not
a viable approach if you are writing databases for other people to use,
since the MDE is highly desirable to prevent people fiddling with or
accidentally decompiling (and so corrupting) your application.

When you reassign a form's RecordSource, you also need to guard against
having text boxes bound to fields that disappear (no longer in new
recordsource) or change type (especially relevant for calculated fields).
Access seems to evaluate the fields and their data types when the form
opens, so if things disappear or change type later, you can easily crash
Access (and possibly corrupt your mdb).

What we tend to do is to provide unbound text/combo boxes in the Form Header
section, with command buttons for Filter and RemoveFilter. These are
constantly available, more intuitive that FBF, and also allow to to avoid
some of the many Filter bugs in Access.
 
R

Rick Brandt

Allen Browne said:
Paul, I think your abilities have outgrown the usefulness of the
Filter-By-Form (FBF) interface.

There are several issues with FBF, such as the one you hightlight. A more
severe one is that it does not work with an MDE file. That means FBF is not
a viable approach if you are writing databases for other people to use,
since the MDE is highly desirable to prevent people fiddling with or
accidentally decompiling (and so corrupting) your application.

FBF works just fine in MDEs (just not in the Runtime).
 
P

Paul Mars

Thanks Allen,

I have filtered similar to your suggestion in the past. However I just
finally took the time to learn about FBF and it seemed to fit the bill, but
I guess there is no substitute for the tried and true.

Paul
 
P

Paul Mars

thanks and tell me how u do that fake e mail thing for the ngs. I have fake
e mail address' in my OE~Tools~Account~News~Properties~E mail and Reply to.
And people and spammers still click reply and my correct e mail is used. I
tried it and I received it.
 
R

Rick Brandt

Paul Mars said:
thanks and tell me how u do that fake e mail thing for the ngs. I have fake
e mail address' in my OE~Tools~Account~News~Properties~E mail and Reply to.
And people and spammers still click reply and my correct e mail is used. I
tried it and I received it.

Mine is not a fake Email address. It's a hotmail account that I never read. I
check in just often enough to keep the account open and have it filtered to
reject all messages except those that come from me.
 
R

Rick Brandt

Paul Mars said:
so how do I change my default e mail address for ngs only??

Depends on what you're using I guess. I use Outlook Express and when I set up
the properties for a particular News server I just enter the hotmail address
instead of my normal one.
 

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