Mixing up

R

rob p

One table, form and then report with a deletefield checkbox. On my form,
filter deletefield=0. That gives me all unchecked. Works. I have a command
button on the form to preview report (and print only unchecked records).

Dim stDocName As String
Me.Filter = "deletefield=0"
stDocName = "rptboxunchecked"
DoCmd.OpenReport stDocName, acPreview, , Me.Filter
this works too.
----------------
On another form, filter (([tblcompany Query].[Client Inactive]=0)). This
will display all clients not checked inactive.
When I have two forms with filters one or the other work but somewhere along
the line one form or the other picks up the others filter.

Should I put this in a filter? and if so, the filter option on form doesn't
seem to drop down for selecting the macro.
thanks.
 
R

Rob Oldfield

I have to say that I *HATE* filters so I might be biased, but I'd suggest
just setting recordsources instead. Just set me.recordsource to whatever
you want in the load event of the form or report.
 
M

Marshall Barton

rob said:
One table, form and then report with a deletefield checkbox. On my form,
filter deletefield=0. That gives me all unchecked. Works. I have a command
button on the form to preview report (and print only unchecked records).

Dim stDocName As String
Me.Filter = "deletefield=0"
stDocName = "rptboxunchecked"
DoCmd.OpenReport stDocName, acPreview, , Me.Filter
this works too.
----------------
On another form, filter (([tblcompany Query].[Client Inactive]=0)). This
will display all clients not checked inactive.
When I have two forms with filters one or the other work but somewhere along
the line one form or the other picks up the others filter.

Should I put this in a filter? and if so, the filter option on form doesn't
seem to drop down for selecting the macro.


Well, that's a new one on me, but then I've had so many
bizzare things go wrong with the Filter property that I am
not at all surprised.

Whenever I breakdown and think I can use the Filter property
to save me a couple lines of code only to find another
anomally, I revert back to the old standby and set the
form's record source to a constructed SQL statement.

Don't misunderstand, I am only talking about the Filter
property in forms. OpenForm/OpenReport's WhereCondition
argument seems to be rock solid.
 
R

Rob Peterson

Thanks for the suggestions. I have problems with filters disappearing,
resetting, etc. I may try this other tact.
rob

Rob Oldfield said:
I have to say that I *HATE* filters so I might be biased, but I'd suggest
just setting recordsources instead. Just set me.recordsource to whatever
you want in the load event of the form or report.

rob p said:
One table, form and then report with a deletefield checkbox. On my form,
filter deletefield=0. That gives me all unchecked. Works. I have a command
button on the form to preview report (and print only unchecked records).

Dim stDocName As String
Me.Filter = "deletefield=0"
stDocName = "rptboxunchecked"
DoCmd.OpenReport stDocName, acPreview, , Me.Filter
this works too.
----------------
On another form, filter (([tblcompany Query].[Client Inactive]=0)). This
will display all clients not checked inactive.
When I have two forms with filters one or the other work but somewhere along
the line one form or the other picks up the others filter.

Should I put this in a filter? and if so, the filter option on form doesn't
seem to drop down for selecting the macro.
thanks.
 

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