Can't get a RecordCount in a subform

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
 
W

Will Jahns

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
 

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

Top