By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

Popup Form Report Filter

P: n/a
"[MyDate] Between #" & Format(Me![BeginDate], "mm/dd/yy") & "# and #"
& Format(Me![EndDate], "mm/dd/yy") & "# AND [DC] = "'" & Me![DCselect]
& "'"

When running the code above I get the following error:

"Microsoft Access can't find the field "|" referred to in your

The code works fine when just using the "date" filter, but falls apart
when the "DC" filter is included.

Can anyone offer any suggestions as to how to correct the error or
alternatives to the code above?



BTW I have reposted this code which is related to another thread as I
require urgent assistance. This problem is holding back a project
which must be completed in 2 days time.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
I would really appreciate any help on this one.

The following code works perfectly:

DoCmd.OpenReport "rptthruputdaily", acViewPreview, , "[MyDate] Between
#" & Format(Me![BeginDate], "mm/dd/yy") & "# and #" &
Format(Me![EndDate], "mm/dd/yy") & "#"

The following does not:

DoCmd.OpenReport "rptthruputdaily", acViewPreview, , "[DC] =

I get a prompt asking for the value of me!DCSelect

Even if I change the fields to [Mydate] = Me![BeginDate] (which works
above) the fields are not recognised.

Do I need to specify the format (which is text) in order for the
system to recognise the field?
Nov 12 '05 #2

P: n/a
I have come up with a solution:

DoCmd.OpenReport "rptthruputdaily", acViewPreview, , "[MyDate]
Between #" & Format(Me![BeginDate], "mm/dd/yy") & "# and #" &
Format(Me![EndDate], "mm/dd/yy") & "#"
If Me![DCSelect] <> "" Then
Reports!rptthruputdaily.Filter = "[DC] = '" & Me![DCSelect] & "'"
Reports!rptthruputdaily.FilterOn = True

But I still welcome any suggestions which may be more efficiant.

*** Sent via Developersdex ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.