By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Access text box expression error

P: 6
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!
Jan 6 '12 #1

✓ answered by NeoPa

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.

Share this Question
Share on Google+
4 Replies


100+
P: 759
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.
Jan 7 '12 #2

NeoPa
Expert Mod 15k+
P: 31,263
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.
Jan 9 '12 #3

P: 6
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!
Jan 12 '12 #4

NeoPa
Expert Mod 15k+
P: 31,263
I'm pleased that was a help :-)
Jan 12 '12 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Browse more Microsoft Access / VBA Questions on Bytes