print reports

  • Thread starter Gostap via AccessMonster.com
  • Start date
G

Gostap via AccessMonster.com

Hi;

Probably a stupid question from a newbie;
I have a form with several test results taken during a 24-hour priod.
Each test has a field with time format like this: yyyy-mm-dd hh:mm. (not
primary key)
I want to print a report based on the data in to modes.
First one, specified by one particular time e.g. 2006-12-19 22:37.
That’s no problem. next one, I want to print out every report during one 24-
hour period.
e.g. 2006-12-20 06:30
2006-12-20 15:32
2006-12-20 71:15

i.e. all report chosen by a specific date without any consideration to the
time. I understand I have to format date somehow in VB but how? it will not
work for me.

hope somebody have mercy ïŠ

Best Regards

Gostap
 
S

strive4peace

Hi Gostap,

the OpenReport action has a very useful parameter that allows you to
specify a WHERE clause...

the generic syntax is

DoCmd.OpenReport ReportName, View, FilterName, WhereCondition,
WindowMode, OpenArgs

and, here are some examples:

~~~~~~~~~~
Dim mWhere as string
mWhere = "TestDate >=#12/19/06 22:30# " _
& " AND TestDate <#12/20/06 22:30#"
DoCmd.OpenReport "ReportName", acViewPreview, , mWhere
~~~~~~~~~~~
Dim mWhere as string
mWhere = "DateValue(TestDate)=#12/19/06#"
DoCmd.OpenReport "ReportName", acViewPreview, , mWhere

~~~~~~~~~~~

you can, of course, build the mWhere string instead of literally
specifying it...

If you are using another date format than American, look at this link:

International Dates in Access - Allen Browne
http://allenbrowne.com/ser-36.html


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
G

Gostap via AccessMonster.com

Dear Chrystal

Thank you very much for kind reply!

best Regards

Gostap
Hi Gostap,

the OpenReport action has a very useful parameter that allows you to
specify a WHERE clause...

the generic syntax is

DoCmd.OpenReport ReportName, View, FilterName, WhereCondition,
WindowMode, OpenArgs

and, here are some examples:

~~~~~~~~~~
Dim mWhere as string
mWhere = "TestDate >=#12/19/06 22:30# " _
& " AND TestDate <#12/20/06 22:30#"
DoCmd.OpenReport "ReportName", acViewPreview, , mWhere
~~~~~~~~~~~
Dim mWhere as string
mWhere = "DateValue(TestDate)=#12/19/06#"
DoCmd.OpenReport "ReportName", acViewPreview, , mWhere

~~~~~~~~~~~

you can, of course, build the mWhere string instead of literally
specifying it...

If you are using another date format than American, look at this link:

International Dates in Access - Allen Browne
http://allenbrowne.com/ser-36.html

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
[quoted text clipped - 19 lines]
 
S

strive4peace

you're welcome, Gostap ;) happy to help


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*


Dear Chrystal

Thank you very much for kind reply!

best Regards

Gostap
Hi Gostap,

the OpenReport action has a very useful parameter that allows you to
specify a WHERE clause...

the generic syntax is

DoCmd.OpenReport ReportName, View, FilterName, WhereCondition,
WindowMode, OpenArgs

and, here are some examples:

~~~~~~~~~~
Dim mWhere as string
mWhere = "TestDate >=#12/19/06 22:30# " _
& " AND TestDate <#12/20/06 22:30#"
DoCmd.OpenReport "ReportName", acViewPreview, , mWhere
~~~~~~~~~~~
Dim mWhere as string
mWhere = "DateValue(TestDate)=#12/19/06#"
DoCmd.OpenReport "ReportName", acViewPreview, , mWhere

~~~~~~~~~~~

you can, of course, build the mWhere string instead of literally
specifying it...

If you are using another date format than American, look at this link:

International Dates in Access - Allen Browne
http://allenbrowne.com/ser-36.html

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
[quoted text clipped - 19 lines]
 

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