Please Help re Open Report 
Author Message
 Please Help re Open Report

I am a beginner at programming and having a bit (understatement) of
trouble with VBA.

I'm trying to open a report with a where clause that limits the report
to those records that have a certain date called [DateArchived]. The
variable that that I am trying to use in the WhereClause is a date
variable called Dte.

I have also tried the actual name of the control which is a combo box,
showing dates called [List3], double clicking on it then gives me the
value of Me![List3] = Dte

When I allow this Double-Click sub  to execute the report opens , but
with no records. My problematic line of code looks something like this,
although I've tried all manner of extra ' or " or #.

DoCmd.OpenReport "ReprintOrder", acViewPreview,, "Where [DateArchived]
=  " & Dte & ""  

If anyone can write this line for me, or tell me that I can't open a
report in this way then I may be able to get some sleep again in the
near future.  


not on my computer at the moment.

Thanks Paul Mendlesohn.



Wed, 29 Dec 1999 03:00:00 GMT  
 Please Help re Open Report

Clare,

Quote:
>I'm trying to open a report with a where clause that limits the report
>to those records that have a certain date called [DateArchived]. The
>variable that that I am trying to use in the WhereClause is a date
>variable called Dte.

Something like this:

 dim Dte as date
 Dte = cdate("1/15/1992")  'or whatever

docmd.openreport "rptYourReport", acViewPreview,, _
  "[DateArchived] >= #" & Dte & "#"

Quote:
>DoCmd.OpenReport "ReprintOrder", acViewPreview,, "Where [DateArchived]
>=  " & Dte & ""  

You don't want the word "where" there, and you need to surround the
date literal with ## signs as in my example.

-- Jim Ferguson, FMS
   http://www.fmsinc.com



Thu, 30 Dec 1999 03:00:00 GMT  
 Please Help re Open Report

Clare,

Did you try:

DoCmd.OpenReport "ReprintOrder", acViewPreview,, "Where [DateArchived]

Quote:
> =  #" & Dte & "#"   ?

If that doesn't work, maybe you should check how you've defined  the Dte
variable (is it a variant, string, etc.?).

HIH,

Laura Wilson

Quote:

> I am a beginner at programming and having a bit (understatement) of
> trouble with VBA.

> I'm trying to open a report with a where clause that limits the report
> to those records that have a certain date called [DateArchived]. The
> variable that that I am trying to use in the WhereClause is a date
> variable called Dte.

> I have also tried the actual name of the control which is a combo box,
> showing dates called [List3], double clicking on it then gives me the
> value of Me![List3] = Dte

> When I allow this Double-Click sub  to execute the report opens , but
> with no records. My problematic line of code looks something like this,
> although I've tried all manner of extra ' or " or #.

> DoCmd.OpenReport "ReprintOrder", acViewPreview,, "Where [DateArchived]
> =  " & Dte & ""

> If anyone can write this line for me, or tell me that I can't open a
> report in this way then I may be able to get some sleep again in the
> near future.


> not on my computer at the moment.

> Thanks Paul Mendlesohn.



Sat, 01 Jan 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

2. Please Please help !!! Crystal Report Help Needed

3. Please Help...Crystal Reports..Please Help

4. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

5. Please, please help - VB6 opening and reading a project mpp file

6. PLEASE HELP PLEASE HELP PLEASE HELP

7. Crystal Report Help Please or Tell me where to get Crystal Help

8. Please Help Newbie Crystal Report / VB help needed.

9. Help-"Error5-Logon Failed"-HELP PLease!!!!!!-Crystal Report

10. Open file Dialog Box in Access..Please Help

11. Testing For Open File - Please Help !!

12. help please - file open dialog

 

 
Powered by phpBB® Forum Software