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 2010 Runtime Error 2448 So confused

Discussion in 'Business Applications' started by Dobber92, Dec 22, 2011.

Thread Status:
Not open for further replies.
  1. Dobber92

    Dobber92 Thread Starter

    Joined:
    Jul 21, 2011
    Messages:
    29
    I'm working on a search form in Access 2010 that when the reset button is clicked, all of the controls in the form's header is cleared of info (All combo boxes, text boxes are cleared). I've used this code on 3 other search forms with no problem, but when I try it on this one, a dialog box pops up that reads, "Run-time error '2448': You cannot assign a value to this object" When I hit the debug button it highlights the line of code that just clears the controls for combos and texts. I cannot for the life of me figure out what is wrong with it. Like i said, I have the exact same code being used in other search forms, with no problems.

    Code:
     Dim ctl As Control
        
        'Clear all the controls in the Form Header section.
        For Each ctl In Me.Section(acHeader).Controls
            Select Case ctl.ControlType
            Case acTextBox, acComboBox
                ctl.Value = Null   '<--- This is the line that get highlighted when i press the debug button on the error message
            'Case acCheckBox
             '   ctl.Value = False
            End Select
        Next
     
  2. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    Is there a control source set for either of the controls in the case statement?
     
  3. Dobber92

    Dobber92 Thread Starter

    Joined:
    Jul 21, 2011
    Messages:
    29
    Are you saying is there actually a text box and a combo box in the header to clear? There's only combo boxes. In fact, I thought of that the minute I posted this. Once I erased the code for the textbox and the checkbox, the code worked, so I guess this one is solved.
     
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/1032416

  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