easy one - Open Access form with parameter

I think this should be easy - I am calling a form and passing the ID on which the form should filter - but it doesn't work.

This is the calling line:
DoCmd.OpenForm "Vendor_EvalNotes", , "[Expense_ID]=" & Forms("Project")("sfPartsLines").Form.Expense_ID

[note: when I query the value of Expense_ID in debugger, it DOES show the right value]

and this is the record source of the called form:
SELECT Project_Lines_Expenses.Expense_ID, Project_Lines_Expenses.Eval_Quality, Project_Lines_Expenses.Eval_Timing, Project_Lines_Expenses.Eval_Notes, Project_Lines_Expenses.Eval_Notes_Followup FROM Project_Lines_Expenses;

Any ideas why it doesn't show the right record?

Many thanks
terpsichoreAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

peter57rCommented:
If the expenseid is a number field then i can't see why you would get the wrong record.
Are you sure there is nothing in the form_load or even form_open event that works against getting the selected record?.
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Are you certain that you're properly referring to the Subform control on the Project form? This is the name of the Subform CONTROL, and may or may not be named the same as the form you're using for the Subform.

With Projects form open in Design view, highlight the subform (click on it ONCE, on the edge). Review the Properties dialog - do you see a Property named Source Object? If you do, then you're working with the Subform CONTROL, and that's the name you should use. If you do not see that property, then you're not working with the correct object.
0
terpsichoreAuthor Commented:
sorry - figured it out, what a dumb mistake - there were 2 commas instead of 3... thanks for responding in any caes.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Thanks for the points, but out comments (mine and Peters's) didn't resolve your problem, and therefore shouldn't be accepted. Please accept ONLY your own comment as the solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.