IF statement for more than 1 record

robsworld78

Registered User.
Local time
Yesterday, 19:04
Joined
May 31, 2011
Messages
99
Hi, I want to make an IF statement that says the following

Code:
If Me.OrdersOrdersSubform.Form.RecordSet = more than 1 record Then
     Do something
Else
     Do something else
End If
Thanks
 
You could use a DCount() on the same record source as the subform. I assume that you would want to filter based on the orderID of the main form. The me.orderID might change depending on what event and from where the event is triggered.


IF DCount("*","tableorqueryname","orderID=" & me.orderID)>1 THEN

ELSE

END IF
 
Use the .RecordCount property

Code:
If Me.OrdersOrdersSubform.Form.RecordSet.RecordCount > 1 Then
     Do something
Else
     Do something else
End If
 

Users who are viewing this thread

Back
Top Bottom