SourceObject criteria

  • Thread starter Thread starter gator
  • Start date Start date
G

gator

Can SourceObject include a criteria clause?
I have a comboBox that selects dates and a subform displays records from a
query. Here is some code below...

Private Sub Form_Load()
Child16.SourceObject = "Query.FundsAllYears"
End Sub

Private Sub ComboBox_AfterUpdate()
Child16.SourceObject = "SELECT FundDate,FundID,FundName,Balance FROM
FundsAllYears WHERE [FundDate] = ComboBox;"
End Sub

How do I add criteria to the SourceObject for the AfterUpdate event?
 
Hi gator

Use the LinkMasterFields and LinkChildFields properties:

Child16.LinkMasterFields = "Combobox"
Child16.LinkChildFields = "FundDate"
 
Back
Top