Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    139

    Unanswered: Assign a value to a control on a report

    I'm trying to assign a value to an unbound control on a report but keep getting the error:

    Run Time Error -2147352567 "You can't assign a value to this object"

    strTicket = Me.OpenArgs (This works, variable is assigned a value)

    Me.txtTicket = strTicket (This is where the error occurs)
    Thanks,
    Bill

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    At what point are you trying to do this assignment? Basically, where in the report?
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Mar 2004
    Posts
    139
    I'm trying to do it on Report_Open. I'm sending over an argument and trying to set a control with it.

    I've looked into it a little, I'm opening the report acViewPreview and I imagine this is the problem. I've found another way to do it but would prefer to just set the control value if possible.

    So to open the report from another form I do:

    DoCmd.OpenReport "rptConsumer", acViewPreview, , , acWindowNormal, strTicketNumber

    And then the report itself...

    Private Sub Report_Open

    strTicketNumber = Me.OpenArgs

    Me.txtTicketNumber = strTicketNumber

    End Sub
    Thanks,
    Bill

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    You have to do that oin a format section (depending on where the control is located) ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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