Results 1 to 4 of 4
  1. #1
    Fran is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    4

    Help with runtime error 2448 you can't assign a value to this object

    Hi folks

    Please can someone tell me where I am going wrong to get this error?



    I have a main form (frmsearch) which has controls on it that are used to search the records in the subform (frmentries). The subform runs off a query which looks to frmsearch to get the criteria. The controls on frmsearch are a combination of text boxes and combo boxes, and date fields which can be filled in using a calendar contol.

    There are two command buttons, one to execute the search, and another to clear all search fields to start again. It's in the clear search command that I get the error.

    This is the on click event, the debugger highlights "ctl.value = null":

    Private Sub cmdclearsearch_Click()
    For Each ctl In Me.Controls
    Select Case ctl.ControlType
    Case acTextBox, acComboBox, acListBox, ocxcalendar2
    ctl.Value = Null
    Case acCheckBox
    ctl.Value = False
    End Select
    Next ctl
    Me.Refresh
    Form_frmentries.Requery

    End Sub

    What am I missing here?!

    Many thanks
    F

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Break out your first Case into 4 separate case statements and you will find which one is giving you a problem. I think it is probably the ActiveX calendar.

  3. #3
    Fran is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    4
    Thanks, but I've just figured it out. I saw another post on here about something similar that said to check if any of the controls had control sources. I was convinced none of mine had but I realised I'd put in another text box to test something out and then forgot about it. That control had a control source so now I've deleted it and it works now!

    Thanks anyway!
    F

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excellent! I guess you are ready to follow the link in my sig and mark this thread as Solved.

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

Similar Threads

  1. runtime error 2448
    By ds_8805 in forum Forms
    Replies: 3
    Last Post: 04-14-2010, 07:32 PM
  2. Help With Runtime Error 4248
    By KLahvic in forum Programming
    Replies: 1
    Last Post: 04-09-2010, 07:47 AM
  3. Replies: 3
    Last Post: 03-30-2010, 01:21 PM
  4. Runtime 3075 error
    By whm1 in forum Programming
    Replies: 4
    Last Post: 03-24-2010, 02:50 PM
  5. Replies: 5
    Last Post: 08-05-2009, 04:07 PM

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