Link to home
Start Free TrialLog in
Avatar of Matt Johnson
Matt Johnson

asked on

Access 2010 Not Recognizing Form

I have created a small purchase order / receiving data base.  The initial screen is a form that shows all current purchase orders.  If a user clicks on one of the PO numbers on that form, they are supposed to be taken to the PO detail form for the PO number that was clicked (using OpenForm macro).  This has worked for several months.  However, today, when I do this action it is prompting me to enter the paramater value of the field I clicked on.  Why is it suddenly not recognizing the form field's value that I'm clicking on?  I am finding that sometimes if I keep playing around with things long enough it will suddenly start working again.  I also have a command button on this form that is supposed to requery it and it also isn't working all the time.

Thanks for your help.
Avatar of unknown_routine
unknown_routine
Flag of United States of America image

If a user clicks on one of the PO numbers on that form, they are supposed to be taken to the PO detail form for the PO number that was clicked (using OpenForm macro).

Provide the macro
Avatar of Matt Johnson
Matt Johnson

ASKER

I copy and pasted from the macro screen what you see below.  Does that help?

<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<UserInterfaceMacros xmlns="http://schemas.microsoft.com/office/accessservices/2009/11/application">
<UserInterfaceMacro For="PONum" Event="OnClick">
<Statements>
<Action Name="OpenForm">
<Argument Name="FormName">fPOMasterForm</Argument>
<Argument Name="WhereCondition">[PONum]=[Forms]![fPurchaseOrders].[PONum
</Argument>
</Action>
</Statements>
</UserInterfaceMacro>
</UserInterfaceMacros>
Avatar of Jeffrey Coachman
I see this:
    Argument Name="WhereCondition">[PONum]=[Forms]![fPurchaseOrders].[PONum
...seems be missing the closing bracket ( ] )

So do this
    Argument Name="WhereCondition">[PONum]=[Forms]![fPurchaseOrders].[PONum]
Also note that if you changed any names, you may also get this error...
No names changed and the missing bracket was due to my editing of the pasted text.  The actual macro has the bracket.  The issue is intermittent and it starts working without me changing anything in any code or forms or macros.  Is this possibly a corruption issue?
I mentioned it briefly originally, but the command button the form that is supposed to requery the form to refresh it gives me the error:  "The expression On Click you entered as the event property setting produced the following error:  Object or class does not support the set of events."
So what error are we investigating?

The parameter prompt, or this new error?
I'm thinking they are connected.  Ultimately the issue is the parameter prompt, but I thought the second error might be an additional clue.
Again the parameter prompt typically shows up because a name was changed somewhere.
In other words, Access sees something new... It does not know what it is, so it prompts you for the value.
I can see where that could be the issue, but I can't find anywhere that I changed the PO header form or PO number field name and it does not consistently give me this error as shown in the scenario I just uncovered below:

If I type in the PO number parameter value on the prompt it continues to the PO detail form correctly , but when I attempt to return from the detail form to PO header form it gives me a runtime error saying the "object or class does not support the set of events".  I press the debug option and it takes me to a line of code that is attempting to requery the PO header form that is giving me the issues.  From the VBA screen, I press continue and this time the requery seems to work without issue.  At this point, if I now select one of the PO's off the PO header to see the detail, everything works just as it should with out issue and I see no more prompts to enter the PO number.  What would cause this issue initally when I first open the database but then make it go away when I go through the scenario above?
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
We hit busy season in the middle of this issue, so I worked around it.  Finally got back to it and the above suggestion gave me the idea of saving a copy of the data base, swapping names with the original database and then re-trying the copied & renamed database.  That took care of things.