Results 1 to 2 of 2
  1. #1
    rhewitt is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    74

    Is there a way to code around Error 2450: Access can't find the referenced form?

    I have a report that pulls one bit of information from a form. If the form isn't open for some reason Access throws Error 2450: Microsoft Access can't find the referenced form "frm_Contact". I'm trying to program around this by setting the textbox to an empty string if I can't get the value from the form, but the error is still thrown.



    Code:
        If Not IsNull(Forms!frm_Contact.cboxContact) Then
            Me.tboxName = Forms!frm_Contact.cboxContact
        Else
            Me.tboxName = ""
        End If
    Is there a way to program around this to prevent Access from throwing an error? I don't want my users going into the debugger just because a form isn't open.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    The general syntax for checking to see if a Form is Loaded would be:
    Code:
    If Currentproject.AllForms("YourFormName").IsLoaded Then
     'Form Open code here
    Else
     'Form Closed code here
    End if

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Run-Time Error 2450
    By dascoli in forum Programming
    Replies: 7
    Last Post: 05-28-2013, 10:49 AM
  2. Replies: 1
    Last Post: 06-27-2012, 09:16 AM
  3. Replies: 9
    Last Post: 06-08-2012, 07:52 AM
  4. Compile Error: Can't find out what's wrong with the code.
    By vickan240sx in forum Programming
    Replies: 4
    Last Post: 05-24-2012, 06:25 PM
  5. error run time 2450
    By storm1954 in forum Forms
    Replies: 2
    Last Post: 05-11-2012, 06:05 AM

Tags for this Thread

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