• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

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
  • 2
1 Solution
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?.
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.
terpsichoreAuthor Commented:
sorry - figured it out, what a dumb mistake - there were 2 commas instead of 3... thanks for responding in any caes.
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now