Microsoft Knowledge Base Email Alertz

(207662) - When you open a form that contains a subform or a report that contains a subreport, you may receive an unexpected prompt to enter a parameter value.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 207662 - Last Review: June 28, 2004 - Revision: 2.0

ACC2000: Parameter Prompt If LinkMasterFields or LinkChildFields Contains Table Name

This article was previously published under Q207662
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

Moderate: Requires basic macro, coding, and interoperability skills.

On This Page

SYMPTOMS

When you open a form that contains a subform or a report that contains a subreport, you may receive an unexpected prompt to enter a parameter value.

CAUSE

The LinkMasterFields or LinkChildFields property of the subform or subreport contains a reference to the underlying table or query. This table or query could be the record source of the main form, the main report, the subform, or the subreport. The property's value is in the format
MainTable.FieldName
Because the reference to the table or query underlying the form or report is implied, it is not necessary to include the table or query name in the LinkMasterFields or LinkChildFields property.

RESOLUTION

Use one of the following resolutions to correct the behavior of the form or report:
  • Do not refer to the underlying table or query in the LinkMasterFields or LinkChildFields property.

    -or-
  • Refer to a control name on the main form or report that contains the appropriate value for the link criteria.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.
  2. In the Database window, click Forms under Objects, and then click New.
  3. In the New Form dialog box, click Form Wizard, and then click OK.
  4. On the first screen of the Form Wizard, click Table: Categories in the Table/Queries list.
  5. Move the CategoryID, CategoryName, and Description fields from the Available Fields list to the Selected Fields list.
  6. Click Table: Products in the Table/Queries list.
  7. Move the ProductID, ProductName, CategoryID, and UnitPrice fields from the Available Fields list to the Selected Fields list, and then click Next.
  8. On the screen that asks you how you want to view your data, click By Categories, and then click to select Form with subform(s). Click Next.
  9. When asked what layout you would like for your subform, click to select Datasheet, and then click Next.
  10. When asked what style you would like, click Standard, and then click Next.
  11. When asked what titles you want for your forms, type frmLinkMain in the Forms box and frmLinkSub in the Subform box. Then click Finish.
  12. On the View menu, click Design View.
  13. Right-click frmLinkSub, and then click Properties.
  14. Change the LinkChildFields property to Products.CategoryID, and change the LinkMasterFields property to Categories.CategoryID.
  15. View the form in Form view.

    Note that you are prompted for the parameters Categories.CategoryID and Products.CategoryID.

REFERENCES

For more information about linking main forms and subforms or main reports and subreports, click Microsoft Access Help on the Help menu, type LinkChildFields, LinkMasterFields Properties in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

APPLIES TO
  • Microsoft Access 2000 Standard Edition
Keywords: 
kbprb KB207662
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate