Access text box expression error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brittb
    New Member
    • Jan 2012
    • 6

    #1

    Access text box expression error

    Hi there. I created a very simple database recently with just one query and one report based on that query. Yesterday the query and report worked just fine, and I was easily able to export my reports as PDFs. Today I've tried to do the same thing, but now when I try to export the report to PDF, or even print preview, I'm getting this error:

    "The expression On Format you entered as the event property setting produced the following error: The object doesn't contain the Automation object 'Genotype Query.'."

    I'm no Access expert, so this message is Greek to me. Can you please explain it? I only have one manually built expression on my report, but it didn't seem to be a problem yesterday. This is the expression:

    =Last([Genotype Query]![Specimen])

    Where Genotype Query is my query, and Specimen is the field in that query that I want to show up on the report as a text box (the sub-title for the page). What's weird is that even if I take the expression off the page, I still get the error. What's happening?

    Thanks!
  • Mihail
    Contributor
    • Apr 2011
    • 759

    #2
    I have similar troubles sometimes.
    As long as I can't say why your report work "yesterday" but no more today I say you why my form work "yesterday" but no more today :).

    I have an UNBOUND form.
    I open the form, I make some selections in order to set some variables, then I bound it from VBA by setting it's row source (using an SQL string which include the values from variables). All work fine.
    Then, without to close the form, I switch to design view and I make some modifications. When I close that form Access ask me if I wish to save. Of course I say YES to save my modifications. When I try to reopen the same form... surprise: Access get me a error.

    That because when I run the form, I fill (as I explain) it's Row Source. When I chose to save the form also I save this modifications. So, my form become... a bound form. A bound form to an SQL string based to some variables which not exist before I set it from the form => error.

    I try to explain as better I can using my poor English.
    Hope is a help for you to point you in the right direction.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32669

      #3
      It sounds like the OnFormat property of the form (or possibly even one of your controls) has been set to something other than the string "[Event Procedure]", or the name of a valid macro. It's hard to be more precise as we rely on what you tell us and the details of what is in each property are not included.

      Comment

      • brittb
        New Member
        • Jan 2012
        • 6

        #4
        Aha! All I had to do was delete the On Format event that somehow got placed in the properties for my report. It works now. Thanks!

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32669

          #5
          I'm pleased that was a help :-)

          Comment

          Working...