[AccessD] how to have access ignore a form that is canceled

Bob Walsh BWalsh at acumentra.org
Tue Jul 28 08:36:29 CDT 2015


Are you doing a Cancel or a Close Form?
Are you doing it in the Form_Open routine or in the Form_Load routine?

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson
Sent: Monday, July 27, 2015 6:40 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] how to have access ignore a form that is canceled

Rocky and Bob yes those would be good ideas but they are not really answering my question my question is why is this happening when in my opinion I am given the chance to cancel the opening of the form in that forms code module and I don't really see why that needs to result in an error that I cannot suppress On Jul 27, 2015 5:30 PM, "Rocky Smolin" <rockysmolin at bchacc.com> wrote:

> How about testing for Me.ID before opening:
>
> If Not IsNull(Me.ID) Then DpCmd.OpenForm...
>
> Rocky
>
>
> -----Original Message-----
> From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf
> Of Bill Benson
> Sent: Monday, July 27, 2015 12:38 PM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] how to have access ignore a form that is canceled
>
> I am running this
>
> DoCmd.OpenForm "frmComments", acNormal, , , acFormEdit, , CStr(Me.ID)
>
> When the openargs is null, I cancel form load.
>
> How can I get Access to ignore that the form wont open instead of
> throwing me into break mode?
>
>
>
> My error trapping is not working, and the problem arised before
> Form_Error in the calling form so I cannot continue past it (which
> makes sense since it is not a data error I guess).
>
> Private Sub cmdAddComment_Click()
> On Error Resume Next
> DoCmd.OpenForm "frmComments", acNormal, , , acFormEdit, , CStr(Me.ID)
> If Err.Number <> 0 Then
>     MsgBox "Could not open the comments form"
> End If
> End Sub
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
IMPORTANT NOTE: The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately and delete this message from your computer. Acumentra Health.



More information about the AccessD mailing list