Connecting Tech Pros Worldwide Help | Site Map

Popup Form Report Filter

  #1  
Old November 12th, 2005, 07:10 PM
Nathan Bloomfield
Guest
 
Posts: 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
expression

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?

Regards,

Nathan

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.
  #2  
Old November 12th, 2005, 07:12 PM
Nathan Bloomfield
Guest
 
Posts: n/a

re: Popup Form Report Filter


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] =
Me![DCSelect]"

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?


Thanks.
  #3  
Old November 12th, 2005, 07:12 PM
Nathan Bloomfield
Guest
 
Posts: n/a

re: Popup Form Report Filter


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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Filter a Report from a Pop-Up Form scatterbrain answers 15 November 21st, 2008 06:45 PM
Cant get a criteria form to close zack answers 4 May 8th, 2006 10:35 AM
Filter by Form disabled Dave Griffiths answers 4 November 13th, 2005 04:47 AM
Date Filter Nathan Bloomfield answers 3 November 12th, 2005 06:19 PM