Connecting Tech Pros Worldwide Help | Site Map

Popup Form Report Filter

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:10 PM
Nathan Bloomfield
Guest
 
Posts: n/a
Default Popup Form Report Filter

"[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, 06:12 PM
Nathan Bloomfield
Guest
 
Posts: n/a
Default 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, 06:12 PM
Nathan Bloomfield
Guest
 
Posts: n/a
Default 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!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.