Share via

Basing Subform and Main Form on Same Table

Anonymous
2011-05-21T21:29:28+00:00

I want to base a subform and it's main form on the same table. There are 3 fields to be considered:

DvdMovieID (Autonumber)

DvdMovieTitle (Text)

DvdSynopsis (Rish tex Memo field)

I want DvdMovieTItle in a continuous form and teh DvdSynopsis on the main form.

Thanks,

James

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

Answer accepted by question author

HansV 462.6K Reputation points
2011-05-21T22:31:18+00:00

The subform should not be linked to the main form, i.e. the Link Master Fields and Link Child Fields properties should be blank.

Create the following event procedure for the subform:

Private Sub Form_Current()

    If Me.NewRecord Then

         DoCmd.GoToRecord acDataForm, Me.Parent.Name, acNewRec

    Else

        Me.Parent.Bookmark = Me.Bookmark

    End If

End Sub

This will keep the main form synchronized with the subform

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

9 additional answers

Sort by: Most helpful
  1. Anonymous
    2011-05-21T22:23:47+00:00

    Hmm. Might just stay with my split form. Problem is there are issues when I place the datasheet on the left side. (No current X record of X in Navigation buttons at bottom.)

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-05-21T22:10:13+00:00

    When I select a row in the subform the DvdSynopsis doesn't reflect the data with the selected record. When I select a row in the subform I want DvdSynopsis to show the data associated with that record.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2011-05-21T22:09:03+00:00

    So you want what I'd call an "upside down subform"? If there are 312 movies in the continuous subform, which of the 312 synopses do you want to see on the main form? The currently selected one?

    I'm not sure if it is possible, but you could get the same effect by using two subforms on the same (unbound) mainform, one continuous (with nothing in its master/child link fields) and one single. You could have a textbox txtMovieID on the mainform, with its control source set to

    =[continuoussubform].Form!DvdMovieID

    You would then set the Master Link Field of the single form subform to the name of this textbox.

    Was this answer helpful?

    0 comments No comments
  4. HansV 462.6K Reputation points
    2011-05-21T21:49:15+00:00

    And your question is?

    Was this answer helpful?

    0 comments No comments