VBA Report Recordsource problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WindowsAndDoors
    New Member
    • Oct 2006
    • 4

    #1

    VBA Report Recordsource problem

    Hey,

    I'm trying to assign to a report recordsource a variable name but I keep getting a message that the database isn't recognizing the control name.

    The name of the report is BusinessUnitPro ductMeeting and this is how I'm referencing it in my VBA code in a Report_open procedure:

    Reports!Busines sUnitProductMee ting!Controls!R ecordsource = rpt_recordsourc e

    What is wrong with the way I have that statement formed?

    This is being done with VBA 6.3 on a Access 2002 db runtime error 2465 "can't find the field 'Controls' referred to in your expression"

    Thanks
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Hi,

    In fact you don't specify for which control you set up the control source! If it's for all the report you don't need to use this line:

    Reports!Busines sUnitProductMee ting!Controls!R ecord source = rpt_recordsourc e


    but this one:

    Reports!Busines sUnitProductMee ting.Record source = rpt_recordsourc e

    :)

    Comment

    • PEB
      Recognized Expert Top Contributor
      • Aug 2006
      • 1418

      #3
      Sorry,

      Reports!Busines sUnitProductMee ting.Recordsour ce = rpt_recordsourc e

      Comment

      • WindowsAndDoors
        New Member
        • Oct 2006
        • 4

        #4
        Thanks PEB works like a charm

        Comment

        Working...