[AccessD] Error 2501, 'the open form action was cancelled'

rosalyn.clarke at barclays.com rosalyn.clarke at barclays.com
Wed Jun 25 09:25:58 CDT 2008


Yes, "the OpenForm action was cancelled".

No, the form has records all right - I'm filtering using the Where clause in
the OpenForm. The form's based on a stored SQL statement. Both the underlying
SQL and the form itself show all records when opened directly, including the
offending ones. Nothing wrong with the OpenForm statement itself - it opens
at the right record for 95% of records in the database.

Modifying the recordsource doesn't work either. This time I get error 2001
"the previous action was cancelled". This is the code:

  Dim stLinkCriteria As String
    
  stLinkCriteria = "[fldTi_ID]='" & Me![fldTi_ID] & "'"

  'DoCmd.OpenForm "frmTicketLive", , , stLinkCriteria (the old way that's not
working)

  DoCmd.OpenForm "frmTicketLive"
  Forms!frmTicketLive.RecordSource = "SELECT DISTINCTROW <loads of aliased
fields> " _
    & "FROM tlkpSector INNER JOIN (tblNetworkTeamLocal INNER JOIN
(tblHandlerLocal RIGHT JOIN tblTicketLive ON tblHandlerLocal.fldID =
tblTicketLive.fldTi_Handler) ON tblNetworkTeamLocal.fldNetworkTeamID =
tblTicketLive.fldTi_NetworkTeam) ON tlkpSector.fldSectorID =
tblNetworkTeamLocal.fldSectorID " _
    & "WHERE fldTi_ID = '" & Me.fldTi_ID & "' " _
    & "ORDER BY tblTicketLive.fldTi_Seq;"

Again, taking this SQL and running it with the syntax
[forms]![frmCallingForm]![fldTi_ID] in place of me.fldTi_ID works perfectly.
Stepping through the code shows fldTi_ID being passed to the SQL statement
correctly.

Huff.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
Beach Access Software
Sent: 25 June 2008 14:46
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Error 2501, 'the open form action was cancelled'

Is the description of the error "The OpenForm action was cancelled".

I usually trap this if a report has no data.  Is it possible the form has no
records?  How are you filtering form?  Modifying a stored query?  Modifying
the RecordSource?  Using Me.Filter? Using the Where clause in the OpenForm?

Which ever one you're using I'd try one of the alternatives.

HTH


Rocky Smolin
Beach Access Software
858-259-4334
www.e-z-mrp.com
www.bchacc.com
 
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
rosalyn.clarke at barclays.com
Sent: Wednesday, June 25, 2008 6:33 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Error 2501, 'the open form action was cancelled'

Hi all

A quickie, I hope... I am getting error 2501 when trying to open a form and
filter it to a single record. The thing is this only happens for certain
records - for most records it is fine, but when it breaks, it breaks
reliably. The records are in the dataset behind the target form. I can open
the form showing all records and filter for the specific ones I want, using
the same field I'm passing in the openform statement. I can stick the
criterion in the underlying query and that works fine too. But it won't open
the form to these  records using docmd.openform.

I have compacted and repaired the database, and I've tried creating a new
form and linking from there in case the calling form was corrupt. It doesn't
work from the new form either.

Any ideas? Any help would be much appreciated

Roz

This e-mail and any attachments are confidential and intended solely for the
addressee and may also be privileged or exempt from disclosure under
applicable law. If you are not the addressee, or have received this e-mail in
error, please notify the sender immediately, delete it from your system and
do not copy, disclose or otherwise act upon any part of this e-mail or its
attachments.

Internet communications are not guaranteed to be secure or virus-free.
The Barclays Group does not accept responsibility for any loss arising from
unauthorised access to, or interference with, any Internet communications by
any third party, or from the transmission of any viruses. Replies to this
e-mail may be monitored by the Barclays Group for operational or business
reasons.

Any opinion or other information in this e-mail or its attachments that does
not relate to the business of the Barclays Group is personal to the sender
and is not given or endorsed by the Barclays Group.

Barclays Bank PLC.Registered in England and Wales (registered no. 1026167).
Registered Office: 1 Churchill Place, London, E14 5HP, United Kingdom.

Barclays Bank PLC is authorised and regulated by the Financial Services
Authority.

--
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

This e-mail and any attachments are confidential and intended solely for the addressee and may also be privileged or exempt from disclosure under applicable law. If you are not the addressee, or have received this e-mail in error, please notify the sender immediately, delete it from your system and do not copy, disclose or otherwise act upon any part of this e-mail or its attachments.

Internet communications are not guaranteed to be secure or virus-free.
The Barclays Group does not accept responsibility for any loss arising from unauthorised access to, or interference with, any Internet communications by any third party, or from the transmission of any viruses. Replies to this e-mail may be monitored by the Barclays Group for operational or business reasons.

Any opinion or other information in this e-mail or its attachments that does not relate to the business of the Barclays Group is personal to the sender and is not given or endorsed by the Barclays Group.

Barclays Bank PLC.Registered in England and Wales (registered no. 1026167).
Registered Office: 1 Churchill Place, London, E14 5HP, United Kingdom.

Barclays Bank PLC is authorised and regulated by the Financial Services Authority.




More information about the AccessD mailing list