Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2010
    Location
    Huntsville, Alabama
    Posts
    11

    Question Unanswered: Access 2007, How do I reference a value in a field on a report?

    How do I reference a value in a field on a report? I'm relatively new to Access 2007 and I would like to load variables with data from a report. I know how to do it in a form:

    dim dirval as string

    dirval = Me!DIRECTORATE.value


    But this does not work when you are working with a report, when I try to do this I get "Run-Time error '2424' The expression you entered has a field, control or property name that XXX database cannot find", and when I click the 'debug' button it points to my 'dirval =' statement.

    How do I reference a value in a field on a report? I guess that is what I need to know. Because, this is making me sweat and I need to figure this out as soon as possible.

    So, if anyone can help, please do! I will owe you one.

    Thanks.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The same method should work. What event do you have it in? Values are not yet available in the Open event, if memory serves.
    Paul

  3. #3
    Join Date
    Aug 2010
    Location
    Huntsville, Alabama
    Posts
    11

    Thumbs up Still New to Access, Thank You, Luck Me.

    Lucky me,

    It was in the Report_Open event, fortunately I was able to circumvent the whole issue by using the Record_Source property in the Main Report properties. I was able to retrieve my data, order it, and have it display itself properly on the form.

    No I am no longer sweating it out...lol...

    Thank you for your response though, I do appreciate it.

    Ya'll have a good day now.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Happy to help, and welcome to the site by the way!
    Paul

Posting Permissions

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