Results 1 to 3 of 3
  1. #1
    karoly is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    5

    Perplexing Problem

    I have a strange problem with Access 2007 which I cant figure out in the design mode. I have form2 which uses a field field1 in form1 in its load event using the notation


    field2 = Forms!start!field1.

    But in run mode when I close the application when form2 is in focus, the execution runs through the form load event of form2 and causes the following error:
    can't find the form 'form1' referred to in a macro expression or Visual Basic code.

    The error occurs because when the application is closed form1 closes first, making its field1 unavailable for form2, but why the execution runs through the load event of form2, that too only when form2 is in focus? I managed a work around by checking if form1 is open in form2 load event, but it is disturbing to see execution running through unintended path.

    I have also discovered that even within the load event of form1 execution extends only upto this accessing of field2 and not thereafter, when the application is closed!!!

    Can any one throw some light in this regard? Thanks in advance.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It is unlikely happening the way you are describing unless the event engine for Access is broken. If Form1 was opened before Form2 then Form2 will close before Form1 in reverse order. Try importing your db into a fresh db and see if the problem follows.
    http://www.btabdevelopment.com/ts/impnew

  3. #3
    zyltar is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    6
    Hi,

    Question : Does the value in frm1 change while frm2 is open ?
    If no : use openarg to open frm2 and set the value of your field in the openarg as openarg value

    If yes : Use a global variable (not the cleanest way but it should works).

    Hope it helps.
    Regards,

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Perplexing Make Table error
    By jgelpi16 in forum Queries
    Replies: 4
    Last Post: 05-26-2011, 08:46 AM
  2. Replies: 2
    Last Post: 06-14-2010, 03:25 PM
  3. query problem i have a problem wi
    By maxx3 in forum Queries
    Replies: 0
    Last Post: 06-29-2009, 02:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums