Allow Additions On/Off

spinkung

Registered User.
Local time
Today, 13:46
Joined
Dec 4, 2006
Messages
267
Hi all,

I have a subform which is filtered by a combo box. if, when the filter is applied, there is no record returned i would like to turn allow addition ON. if there is a record returnd based on the filter i would like to turn the allow additions OFF.

Can anyone advise me on how to find whther the filter has returned any results??? I thought i might be able to use the current record property but, alas, i failed.

Anyone??

Thanks, Spin.
 
Try this in the after update event of the combo:
Code:
   Me.AllowAdditions = (Me.RecordsetClone.Recordcount = 0)

(untested code)
 
thanks bob,

unfortunately it never worked which is a shame because it looked a much cleaner way than what i've come up with. i have got this working but it feels like i'm over complicating things????

Code:
Set rs = frm_INVOICE_TOOL_stages.Form.Recordset
If Not (rs.EOF And rs.BOF) Then
frm_INVOICE_TOOL_stages.Form.AllowAdditions = False
Else
frm_INVOICE_TOOL_stages.Form.AllowAdditions = True
End If

any improvement would be appreciated.

Thanks,
spin.
 

Users who are viewing this thread

Back
Top Bottom