Results 1 to 6 of 6
  1. #1
    123noob is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2017
    Posts
    14

    Error 2467 When Trying to Reach Report Controls


    Hi everyone, I am currently at a halt right now on enhancing my report printout. On my previous version I have a color picker form for custom color selection as a separate window that will update the font colors of the fields/controls on a second window for report (in report view). But I decided it would look better to have one form with color picker form being the parent form and report as a SubReport on the form so that way it would be more intuitive for the FE users to use.

    However, in doing so, whenever the main form is loaded (the report which gets loaded first doesn't trigger onLoad event that calls for another procedure(s) to dynamically update the report fields). And after everything is loaded, I have to manually click onto the subreport in order to get this onLoad even fired. In addition, now any controls referenced from the procedures called by onLoad of the report events trigger the 2467 error when trying to edit caption or text on the label or text controls (not sure if same for cells if trying to modify the width/height etc...) EXCEPT the SubReport report(s) of the main report.

    I've tried to explicitly reference the controls on the report like [Reports]![report_name]![control_name].Caption or .value or .text but no luck.

    Is there anyway to resolve this? I've thought of moving this procedure out of the report and onto the parent form to see if it works but that would be rewriting. Please see below for my short sample codes...

    Code:
    On clicking accept new color from Color Picker form as a separate window: this will iterate through the Report Window to update the font colors... and I kept the same codes when adding the main report to the main form under subform of the main form.
    
    On Report Form:
    onLoad: (doesn't auto trigger when the report is loaded as a subForm/Report on the color picker form - otherwise this works fine if it was opened as a separate window)
    Call setEnviron
    Private Sub setEnviron()
    Select Case Me.txtRequestType
    Case "New Test", "New Custom Panel"
    Call setEnvironNew
    Case "Discontinuation", "Result Code Addition"
    Call setEnvironDisc
    Case Else
    ' Do nothing, use default report page setup
    End Select Call verifyElements
    End Sub Private Sub verifyElements()
    Here I've just included a sample to where it gives the error With Me
    If .childCurrentTestComps.Report.Controls("txtCount") = 0 And .childNewTestComps.Report.Controls("txtCount") = 0 Then Here the if statement recognized the subReport control and its' report's control "txtCount"
    Starting the line in blue gives the error.
    .lblCurrentTestComp.Caption = .lblNewTestComp.Caption ...
    End If ... more codes
    End With
    End Sub
    What I tried is I did iteration by dimming a ctl to go through the controls collection on the report and print out the label and text control values/caption to the immediate window and it works fine.

    So I'm really not sure what's going on. Hopefully what I put out made sense... I'll try my best to explain it.

    Thank you again!

  2. #2
    123noob is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2017
    Posts
    14
    Oh and on the parent form (color picker) i have the following set up:

    Data Entry = No
    Allow Additions = Yes
    Allow Deletions = Yes
    Allow Edits = Yes
    Allow Filters = Yes
    Should Data Entry set to Yes? Suddenly I was thinking this could be the reason why I have no access to modify the control's values or label's captions... I could only read... I'll see if this could be the problem. But please provide any suggestions if possible

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    IIRC I tried putting a report on a form as an experiment, probably in response to a forum question, and while it can be done, it doesn't work. Then again, maybe someone else will prove me wrong. Happens all the time. Can't recall anyone ever wanting to colour report text or controls on the fly either.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    123noob is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2017
    Posts
    14
    Well the report in this case that I use is like a coversheet and depending on the type of request it would change accordingly through vba instead of having to create multiple reports and with the option of given the user to select his/her color of choice is a nice touch. Hopefully I can find a resolution for this else I have to go back to having 2 pop ups .

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    If this is based on some kind of choice, why not open the report in design view, hidden, alter the properties, open in report or print preview...
    Or is conditional formatting not an option, based on some report flag such as its title?

  6. #6
    123noob is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2017
    Posts
    14
    Couldn't get it to work in the end. I wish it could since it would have a nicer look overall. However, I ended up just open the report in report view then hide and have the codes run to modify the controls' properties. After the user has selected a color of their preference, the specific controls will be updated to the new color then print.

    Idea of having it opened in design view could work as well then have it loaded as a sub report on the color selector form after could work. But I'll have to wait to try that out later since not enough time is given.

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

Similar Threads

  1. Replies: 4
    Last Post: 01-25-2019, 02:42 PM
  2. 2 gig file limit reach
    By kgj in forum Access
    Replies: 4
    Last Post: 10-22-2018, 01:51 AM
  3. Subform properties, Access 2013, error 2467
    By Rdiamond in forum Forms
    Replies: 3
    Last Post: 12-15-2015, 12:22 PM
  4. Replies: 2
    Last Post: 03-13-2015, 09:11 AM
  5. Error 2467
    By Ray67 in forum Forms
    Replies: 1
    Last Post: 01-26-2013, 11:41 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