How to determine if subform has record or not

  • Thread starter Thread starter SF
  • Start date Start date
S

SF

Hi,

I have a Master/Sub form for data entry. Before doing data entry, I want to
check the number of record of the subform, If subform is empty then add
commune names that belong to the Master ID project thru append query (So
that user will have a list of communes ready)

SF
 
One way is to check the RecordCount of the subform's recordset:

If Me.SubformName.Form.Recordset.RecordCount = 0 Then
' no records
Else
' at least one record
End If



where SubformName is the name of the subform control (the control that holds
the subform object).
 
Back
Top