ili_sophia
Registered User.
- Local time
- Tomorrow, 03:51
- Joined
- Aug 23, 2017
- Messages
- 40
Hi there,
I have a form where the users can select the date and it will display the data in the subform. I would like to have a command button to show all the available records in the subform.
I have attempted a code below. but I understand that from Dmin and Dmax is wrong.
how do I reference a subform?
Private Sub Command151_Click()
Dim task As String
Me.KnittingStartDate = DMin("Date", "[Knitting Summary subform]")
Me.KnittingEndDate = DMax("Date", "[Knitting Summary subform]")
task = "Select * from [Knitting Summary subform] Order by Date]"
Me.subKnitting.Form.RecordSource = task
End Sub
I have a form where the users can select the date and it will display the data in the subform. I would like to have a command button to show all the available records in the subform.
I have attempted a code below. but I understand that from Dmin and Dmax is wrong.
how do I reference a subform?
Private Sub Command151_Click()
Dim task As String
Me.KnittingStartDate = DMin("Date", "[Knitting Summary subform]")
Me.KnittingEndDate = DMax("Date", "[Knitting Summary subform]")
task = "Select * from [Knitting Summary subform] Order by Date]"
Me.subKnitting.Form.RecordSource = task
End Sub