locked
Access Form Question/Issue RRS feed

  • Question

  • Hello,

    I have an Access form that has a table record source.  The form also subforms that pull related data and approximately (35) fields that use a Control Source similar to "=[frmALbrSubform].[Form]![CabMkrHrs]".  Periodically, something happens and there is a "break" and I receive field errors as shown.  I generally can delete a field and re-enter and the issue is temporarily resolved.

    Any suggestions?


    Thanks PU_RJF

    Wednesday, April 8, 2020 6:23 PM

Answers

  • Three things come to mind:

    1. Never use a table directly as a Record Source for a form. Create a query based on the table and use the query as your Record Source.
    2. If you use references as a Control Source such as "=[frmALbrSubform].[Form]![CabMkrHrs]", then it should be =Forms![frmALbrSubform]![CabMkrHrs]. Delete the .Form parts and Add the Forms! part at the beginning of each reference. No quotation marks.
    3. Make sure each subform is connected to the main form using the subforms Link Master Fields and Link Child Fields properties. Each subforms Record Source should have related fields to the main form Record Source.
    • Marked as answer by PU_RJF Friday, April 10, 2020 5:12 PM
    Wednesday, April 8, 2020 7:04 PM
  • 2. If you use references as a Control Source such as "=[frmALbrSubform].[Form]![CabMkrHrs]", then it should be =Forms![frmALbrSubform]![CabMkrHrs].
    The reference here is to a control in a subform, which is not a member of the Forms collection, so referencing it as such is ruled out.  The OP's syntax is correct, i.e. the control is referenced via the Form property of the subform control in the parent form's Controls collection.  In reality the Form property can be omitted.

    Ken Sheridan, Stafford, England

    • Marked as answer by PU_RJF Friday, April 10, 2020 5:12 PM
    Friday, April 10, 2020 3:15 PM

All replies

  • Three things come to mind:

    1. Never use a table directly as a Record Source for a form. Create a query based on the table and use the query as your Record Source.
    2. If you use references as a Control Source such as "=[frmALbrSubform].[Form]![CabMkrHrs]", then it should be =Forms![frmALbrSubform]![CabMkrHrs]. Delete the .Form parts and Add the Forms! part at the beginning of each reference. No quotation marks.
    3. Make sure each subform is connected to the main form using the subforms Link Master Fields and Link Child Fields properties. Each subforms Record Source should have related fields to the main form Record Source.
    • Marked as answer by PU_RJF Friday, April 10, 2020 5:12 PM
    Wednesday, April 8, 2020 7:04 PM
  • 2. If you use references as a Control Source such as "=[frmALbrSubform].[Form]![CabMkrHrs]", then it should be =Forms![frmALbrSubform]![CabMkrHrs].
    The reference here is to a control in a subform, which is not a member of the Forms collection, so referencing it as such is ruled out.  The OP's syntax is correct, i.e. the control is referenced via the Form property of the subform control in the parent form's Controls collection.  In reality the Form property can be omitted.

    Ken Sheridan, Stafford, England

    • Marked as answer by PU_RJF Friday, April 10, 2020 5:12 PM
    Friday, April 10, 2020 3:15 PM