Continuous subform problem

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hi there

I have a continuous subform which i only want to display the last entry on
the main form but be able to click a command button to take me to the full
list of entries on the subform. or bring up a popup of the full form - is
this possible??

cheers Steve
 
How about reassiging the RecordSource property of the subform?

This example assumes a check box named "chkShowAll" on the main form. In its
AfterUpdate event procedure, assign the desired RecordSource to the subform.

Private Sub chkShowAll_AfterUpdate()
Const conTail = " * FROM [MyTable] ORDER BY [MyDate] DESC;"

With Me.[MySubform].Form
If Me.chkShowAll.Value Then
.RecordSource = "SELECT" & conTail
Else
.RecordSource = "SELECT TOP 1" & conTail
End If
End With
End Sub

(The example determines the most recent record by looking at the MyDate
field.)
 
Back
Top