Share via

Subform control blank after form opened

Anonymous
2016-01-20T01:35:20+00:00

My problem is that the subform control remains blank after opening form, but it is populated when the view is changed from design to form view. This subform is located on a tab control; another subform located on different page of the same tab control loads just fine. The difference is that the one the doesn't load when the form is opened is based on the third query in a cascade of queries; the first query selects records in part based on input from an option group, two combo boxes and one textbox on the main form, the second query then calculates the cumulative product of a field and the third query selects certain records from the second query.

The following steps failed to resolve the problem:

Link Master/Child Fields relationship was established (the subform doesn't need to have this link))

On Open & On Load events of the form:        Me.Requery

Me.QuantATRSumSub.Requery

I think that the problem may be that the form attempts to populate the subform before the default values of controls that provide the criteria are loaded and the underlying query can generate the required dataset. Please let me know if you have a solution.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Tom van Stiphout 40,206 Reputation points MVP Volunteer Moderator
    2016-01-20T01:43:05+00:00

    Sometimes developers get a bit too adventurous with the form's AllowAdditions and DataEntry properties. Make sure the former is set to True, the latter to False. The reverse causes a blank form.

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2016-01-26T00:16:09+00:00

    I find a solution with the help of Tom van Stiphout, who in response to another question about VBA code syntax designed to delay the loading of the subform until the main form is loaded, suggested to delete the Record Source on property sheet of the subforms and add it into the Form_Load of the main form with a sytax like this:

    Me.mySubformControl.Form.RecordSource = "myqueryreferencingparentform"

    This is really simple and work very well.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2016-01-20T12:57:22+00:00

    You may need to Refresh that subform when the form opens. To do that:

    Me.NameOfYourSubformCONTROL.Form.Refresh

    Where NameOfYourSubformCONTROL is the Name of the Subform Control on your form, which may or may not be the name of the form you're using as a Subform.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2016-01-20T18:56:53+00:00

    Hi Scott, I inserted the line that you suggested into the 'On Open' event of the main form. It resulted in a Run-time error '2467'.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  5. Anonymous
    2016-01-20T05:25:41+00:00

    Hi Tom,

    Thank you for response. I have looked into this and now I checked again, the Data Entry was set to No and the Allow Additions/Deletions/Edits/Filters were all set to Yes. Unfortunately, I need another solution.

    Andras

    Was this answer helpful?

    0 comments No comments