1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access: CloseButton = False :: Runtime Error 2448

Discussion in 'Business Applications' started by MRdNk, Apr 3, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. MRdNk

    MRdNk Thread Starter

    Joined:
    Apr 7, 2007
    Messages:
    439
    Hi All,

    Attempting to set the CloseButton property for a subform via a Module, the module is referred to via On Current:

    And the Module (basForms) is:

    But I just get a Run-Time error 2448, "You can't assign a value to this object".

    Real confused as to why its not working.
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    I think that you might need me.name in the basForms.SubFormsSetup(me.name)
    I use this version to close a Form, so you should be able to adapt it to set the control.

    Dim formname As String
    formname = Me.name
    Call Closeform(formname)

    and using a Public Sub

    Public Sub Closeform(formname As String)
    On Error GoTo Err_cmdClose_Click

    DoCmd.Close acForm, formname

    Exit_cmdClose_Click:
    Exit Sub

    Err_cmdClose_Click:
    MsgBox Err.Description
    Resume Exit_cmdClose_Click

    End Sub
     
  3. MRdNk

    MRdNk Thread Starter

    Joined:
    Apr 7, 2007
    Messages:
    439
    The stupid thing is, the following does work:

    Module, for other Form Setup Options:

    However, it breaks on this module:


    I tried your suggestion OBP, but it still doesn't like it!
     
  4. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Have you tried it for the "Control Box", that would remove the Close Button at the same time?
     
  5. MRdNk

    MRdNk Thread Starter

    Joined:
    Apr 7, 2007
    Messages:
    439
    Curiouser and curiouser! It doesn't like that either.

    Now I am confused.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/700087

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice