Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error message can't assign value to object (Access03)

    I keep getting the error message "you can't assign a value to this object" message. Here is my code. What am I missing? Both txtMonthRemaing and txtMonth are unbound boxes

    Function strMonth() As String
    ' Get the Month of the report from the user
    strMonth = Forms!frmReports!txtMth
    End Function

    Private Sub Report_Activate()
    Dim strMonthOfYear As Variant
    strMonthOfYear = strMonth
    txtMonthsRemaining = strMonthOfYear
    txtMonth = strMonthOfYear
    Select Case txtMonth
    Case "July"
    txtMonthsRemaining = 11
    Case "August"
    txtMonthsRemaining = 10
    Case "September"
    txtMonthsRemaining = 9
    Case "October"
    txtMonthsRemaining = 8
    Case "November"
    txtMonthsRemaining = 7
    Case "December"
    txtMonthsRemaining = 6
    Case "January"
    txtMonthsRemaining = 5
    Case "February"
    txtMonthsRemaining = 4
    Case "March"
    txtMonthsRemaining = 3
    Case "April"
    txtMonthsRemaining = 2
    Case "May"
    txtMonthsRemaining = 1
    Case "June"
    txtMonthsRemaining = 0
    End Select
    If txtMonthsRemaining <> 0 Then
    Me.txtAverageNeeded = [txtRemaining] / [txtMonthsRemaining]
    Else
    Me.txtAverageNeeded = [txtRemaining]
    End If
    Exit Sub
    End Sub

    Thank you. Fay

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Error message can't assign value to object (Access03)

    Try to set the value of a text box in the On Format or On Print event of the section that contains the text box.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error message can't assign value to object (Access03)

    Bless you and thank you Hans!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •