Re: Closing Form Produces "Runtime Error 2585"

From: Graham Mandeno (Graham.Mandeno_at_nomail.please)
Date: 05/25/04


Date: Wed, 26 May 2004 10:23:42 +1200

Hi Kevin

DoCmd.Close can behave asynchronously and works on the form which currently
has the focus, so I suspect what is happening is that sometimes you are
attempting to close the MainMenu form while it is in the act of opening.

Always specify what you want to close:
    DoCmd.Close acForm, Me.Name

I see you say you have already tried this, but try it again anyway :-)

My main concern is that you should NEVER store an easily calculatable entity
such as Full Name like this. It is so easy to make a query with a
calculated field to give you the Full Name from its component parts as and
when you need it, and in the format required for the purpose.

I recommend you remove the Full Name field from your table.

-- 
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
"Kevin Rodriguez" <anonymous@discussions.microsoft.com> wrote in message
news:93969617-8941-44D4-B222-D92C63D46BC8@microsoft.com...
> I have a procedure that runs on Click from a form.  The code, in brief:
>
>     DoCmd.RunSQL "UPDATE Contacts SET Contacts.[Full Name] = [LastName] &
', ' & [FirstName] & ' ' & [Title]"
>     DoCmd.Close
>     DoCmd.OpenForm "MainMenu"
>
> I'm getting the above referenced error (error message: This action can't
be carried out while processing a form or report event), but not all the
time.  I can't figure out what is going on to have the error come up
randomly.  I've tried to run it without the SQL statement before the close,
it still fails.  I've been explicit including "acForm, <FormName>" on the
DoCmd, it still fails.  I'm at a loss.
>
> I'm a novice and wondering if I set one of my properties incorrectly, or
what ever...


Relevant Pages

  • Re: Decimal fieldss precision is too small to accept the numeric you attempted to add
    ... I don't know the Scale and Precision of your Decimal fields, ... case something is actually overflowing (as the error message suggests). ... both of those, still fails. ...
    (microsoft.public.access.queries)
  • Re: Unparsable Record
    ... I tried simply importing 1 column - deleting all the rest. ... Method 'ExecuteTempImexSpec' of object '_WizHook' failed error message. ... If that fails, delete 11 more columns so only the first 11 ... importing the first column - skipping all the other columns, ...
    (microsoft.public.access.externaldata)
  • Re: Permanently Disabling Content Advisor
    ... If that fails, post the exact error message to a newsgroup about IE. ...
    (microsoft.public.security)
  • RE: Problem with SetFocus
    ... An Engineers Prayer: ... when all else fails, ... I tried OnError Resume Next to suppress the Error message and now it works ... the error message suppressing. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Error: Data type mismatch in criteria expression
    ... still I am getting the above error message. ... This value is a calculated field. ... > value and this null value is messing up the update statement which is ... > supposed to update the table in the database. ...
    (microsoft.public.inetserver.asp.general)