Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Command Button


Message #1 by "Maha Arupputhan Pappan" <mahap@p...> on Thu, 21 Feb 2002 03:51:14
Hi all,



Good day.



I have inserted a command button (let me call it CB1) in a form (let me 

call it F1). When I click CB1 it opens a report for preview if there is 

record. If no record it should simply display a message and close the 

report immediately without displaying it.



ISSUE:

When I preview the report from the Database Window. I am able to get the 

No_Data Error message box and once I click the OK button the report is 

closed immediately (without displaying it).



However, if I click CB1 from F1 then I receive an additional error message 

box from ACCESS XP itself. The error message is "The OpenReport action was 

cancelled.". The error message box is displayed with a OK button only and 

its title is Microsoft Access.



Please help. Your assistance is higly appreciated.



Thanks,

Maha



Message #2 by John Fejsa <John.Fejsa@h...> on Thu, 21 Feb 2002 15:32:22 +1100
Add this code to your CB1 button click event.



Err_CB1:

    If Err =3D conCancelledAction Then

        'Do nothing

        Resume Exit_PrintReports

    Else

        MsgBox Err & ", " & Error, , "Error Printing Reports"

        Resume Exit_CB1

    End If



Add this code to your Module, ie, Utilities...

'Constants

Const conCancelledAction =3D 2501



That should work for you...





____________________________________________________



John Fejsa

Systems Analyst/Computer Programmer

Hunter Centre for Health Advancement

Locked Bag 10, WALLSEND NSW 2287

Phone: (02) 4924 6336 Fax: (02) 4924 6209

www.hcha.org.au

____________________________________________________



The doors we open and close each day decide the lives we live

____________________________________________________



CONFIDENTIALITY & PRIVILEGE NOTICE

The information contained in this email message is intended for the named 

addressee only.  If you are not the intended recipient you must not copy, 

distribute, take any action reliant on, or disclose any details of the 

information in this email to any other person or organisation.  If you 

have received this email in error please notify us immediately.



>>> mahap@p... 21/02/2002 14:51:14 >>>

Hi all,



Good day.



I have inserted a command button (let me call it CB1) in a form (let me

call it F1). When I click CB1 it opens a report for preview if there is

record. If no record it should simply display a message and close the

report immediately without displaying it.



ISSUE:

When I preview the report from the Database Window. I am able to get 

the

No_Data Error message box and once I click the OK button the report is

closed immediately (without displaying it).



However, if I click CB1 from F1 then I receive an additional error 

message

box from ACCESS XP itself. The error message is "The OpenReport action 

was

cancelled.". The error message box is displayed with a OK button only 

and

its title is Microsoft Access.



Please help. Your assistance is higly appreciated.



Thanks,

Maha










This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient,
please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily
the views of Hunter Health.



Message #3 by "Maha Arupputhan Pappan" <mahap@p...> on Thu, 21 Feb 2002 10:06:03
> Add this code to your CB1 button click event.

> 

> Err_CB1:

>     If Err =3D conCancelledAction Then

>         'Do nothing

>         Resume Exit_PrintReports

>     Else

>         MsgBox Err & ", " & Error, , "Error Printing Reports"

>         Resume Exit_CB1

>     End If

> 

> Add this code to your Module, ie, Utilities...

> 'Constants

> Const conCancelledAction =3D 2501

> 

> That should work for you...

> 

> 

> ____________________________________________________

> 

> John Fejsa

> Systems Analyst/Computer Programmer

> Hunter Centre for Health Advancement

> Locked Bag 10, WALLSEND NSW 2287

> Phone: (02) 4924 6336 Fax: (02) 4924 6209

> www.hcha.org.au

> ____________________________________________________

> 

> The doors we open and close each day decide the lives we live

> ____________________________________________________

> 

> CONFIDENTIALITY & PRIVILEGE NOTICE

> The information contained in this email message is intended for the 

named 

> addressee only.  If you are not the intended recipient you must not 

copy, 

> distribute, take any action reliant on, or disclose any details of the 

> information in this email to any other person or organisation.  If you 

> have received this email in error please notify us immediately.

> 

> >>> mahap@p... 21/02/2002 14:51:14 >>>

> Hi all,

> 

> Good day.

> 

> I have inserted a command button (let me call it CB1) in a form (let 

me

> call it F1). When I click CB1 it opens a report for preview if there 

is

> record. If no record it should simply display a message and close the

> report immediately without displaying it.

> 

> ISSUE:

> When I preview the report from the Database Window. I am able to get 

> the

> No_Data Error message box and once I click the OK button the report is

> closed immediately (without displaying it).

> 

> However, if I click CB1 from F1 then I receive an additional error 

> message

> box from ACCESS XP itself. The error message is "The OpenReport action 

> was

> cancelled.". The error message box is displayed with a OK button only 

> and

> its title is Microsoft Access.

> 

> Please help. Your assistance is higly appreciated.

> 

> Thanks,

> Maha

> 

> 




> 

> This message is intended for the addressee named and may contain 

confidential information. If you are not the intended recipient, please 

delete it and notify the sender. Views expressed in this message are those 

of the individual sender, and are not necessarily the views of Hunter 

Health.

> 

Hey John,



Its me again, Maha. Friend, finally I managed to get it right and so does 

the Close Report thread in my earlier request. You have been very helpful 

to me friend. Please email me at mahap@p...



Thanks Pal.

Maha

  Return to Index