Can't get a RecordCount in a subform

  • Thread starter Thread starter Will Jahns
  • Start date Start date
W

Will Jahns

I have used the basic code found on the forum to check a subform for
records or not.
This piece of test code shows me that I am getting the wrong answer.


Private Sub cbxLastName_Exit(Cancel As Integer)
Dim RecCount As Long
RecCount =
Forms(DeletebrokerSubForm).Form.RecordsetClone.RecordCount
MsgBox RecCount
If Forms(DeletebrokerSubForm).Form.RecordsetClone.RecordCount <> 0
Then
MsgBox "Subform has at least one record "
Else
MsgBox "Subform has no records "
End If
end sub

I sure would like to find out what's up with this.
Thanks in advance,
Will
 
I should add that I am using Access 2002 if it makes a difference.
The combobox fills the form by using a recordset clone.

You can see that I'm on the rusty side with coding and forums.
Thanks,
Will
 
Back
Top