Function Microsoft Access Can't Find

E

Eric Stephens

Here's my situation: I have a table, a form, a query, and a report.

Here's what should happen: when I open the report, there is a macro that
opens the form, which is based on the table. The form allows the user to
select the parameter value for the query (using a drop-down box). The report
is based on the query, which must have the value selected from the form in
order to run. Once the quey runs, the report displays the resulting data
(I've actually gotten this to work before).

Here's what is happening: once I click OK in the form (which initiates a sub
procedure to open the report as acPreview), the action stops. When I click
cancel (the other button in the form), I get the "Function Access Can't Find"
message box. When I click OK to that, I'm prompted to enter a parameter
value--the value that should have been supplied by the selection in the form.

What's going on here? Have I created some kind of strange loop? I am VERY
new to VBA programming so, if you are able to respond, please keep that in
mind.

Thanks much!
 
E

Eric Stephens

None of the references seem to be missing, and I have tried the techniques
listed on your website but am still having the problem: I have the following
checked (in this order):

- VBA
- Access Object Library
- OLE Automation
- ActiveX Data Objects Library

Eric
 
L

LeeLi

I had experienced this prob before. mostly you have to check your query
statement,if I remember corrrectly because my microsoft office currupted.
furthermore, you have to check the query value name which have to match with
the form name or table name.
 
E

Eric Stephens

I've checked all that and it all matches. The report runs properly when I run
the macro itself (e.g., when I don't open the report directly). I created the
macro based on Microsoft's help (which usually sucks!). Here is the macro I
have:

Name Condition Action
OpenDialog OpenForm
Not IsLoaded(formname) CancelEvent
CloseDialog Close
OK SetValue
Cancel Close

SOMEBODY PLEASE HELP!!! THIS IS DRIVING ME INSANE!!! I honestly think a
group of psychologists created Access just to test human endurance limits!!
 
A

Arvin Meyer [MVP]

There can be ambiguous references as well. Both ADO and DAO share some of
the same references. Either you need to disambiguate them like:

Dim rst As DAO.Recordset

or if you don't need the ADO reference (ActiveX Data Objects Library), just
uncheck it.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Top