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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top