Hi,
I'm lost! I have a subform within a form. The main form allows the user to select a site id. There are multiple records associated with each site ID. Each of these child records has a field named "MARINEorFRESHWATER" which is a list delimeted by a colon. The user needs to be able to update these child records on the subform.
First, I set the recordsource of the subform based on the site id that is selected:
Next, the subform uses the recordsource to populate the fields for each record. However, I cannot figure out how to populate the combo box. Not sure where or how to do this.
I'm lost! I have a subform within a form. The main form allows the user to select a site id. There are multiple records associated with each site ID. Each of these child records has a field named "MARINEorFRESHWATER" which is a list delimeted by a colon. The user needs to be able to update these child records on the subform.
First, I set the recordsource of the subform based on the site id that is selected:
Code:
Form![UpdateSpeciesSub].Visible = True
If Me.listSitesEditSpecies.ListCount > 0 Then
For i = 0 To Me.listSitesEditSpecies.ListCount Step 1
If Me.listSitesEditSpecies.ListIndex = i - 1 Then
SiteID = Me.listSitesEditSpecies.Column(1, i)
End If
Next i
End If
If SiteID <> "" Then
strSQL = "SELECT DISTINCT d.[Organism Common Name], s.ID2, s.ID1, s.ID, s.SPECIES_NUMBER, s.LATIN_NAME, s.KINGDOM, s.PHYLUM_DIVISION, "
strSQL = strSQL & "s.Class , s.TAX_ORDER, s.FAMILY, s.GENUS, s.SPECIES, s.MARINEorFRESHWATER, s.[User Entered] "
strSQL = strSQL & "FROM DATA d INNER JOIN tblSpeciesBSAF s ON d.[Organism Latin Name] = s.LATIN_NAME "
strSQL = strSQL & "WHERE D.[Site ID] = '" & SiteID & "'"
Set rs = CurrentDb.OpenRecordset(strSQL)
Form![UpdateSpeciesSub].Form.RecordSource = strSQL
End If
Next, the subform uses the recordsource to populate the fields for each record. However, I cannot figure out how to populate the combo box. Not sure where or how to do this.