A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Code help



 
 
Thread Tools Display Modes
  #1  
Old August 17th, 2009, 06:52 AM posted to microsoft.public.access.gettingstarted
Richard
external usenet poster
 
Posts: 1,419
Default Code help

Hi all,

I would like to setup a command button to print reports using this criterion
if possible. If records =Date() then print report, else DoCmd.RunCommand
acCmdPrint. If the date matches today’s date print my report other wise show
me the print dialog box.

Thanks
Richard

  #2  
Old August 17th, 2009, 11:45 AM posted to microsoft.public.access.gettingstarted
NG[_2_]
external usenet poster
 
Posts: 59
Default Code help

Hi,

you might try something like

If myDate = Date Then
DoCmd.OpenReport "MyReport", acViewNormal
Else
DoCmd.OpenReport "MyReport", acViewPreview
End If


--
Kind regards
Noëlla


"Richard" wrote:

Hi all,

I would like to setup a command button to print reports using this criterion
if possible. If records =Date() then print report, else DoCmd.RunCommand
acCmdPrint. If the date matches today’s date print my report other wise show
me the print dialog box.

Thanks
Richard

  #3  
Old August 17th, 2009, 02:57 PM posted to microsoft.public.access.gettingstarted
Richard
external usenet poster
 
Posts: 1,419
Default Code help

Thanks Noëlla,

I will give your suggestion a try.

Richard


"NG" wrote:

Hi,

you might try something like

If myDate = Date Then
DoCmd.OpenReport "MyReport", acViewNormal
Else
DoCmd.OpenReport "MyReport", acViewPreview
End If


--
Kind regards
Noëlla


"Richard" wrote:

Hi all,

I would like to setup a command button to print reports using this criterion
if possible. If records =Date() then print report, else DoCmd.RunCommand
acCmdPrint. If the date matches today’s date print my report other wise show
me the print dialog box.

Thanks
Richard

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.