No more entry allowed in subform

smyeong

Registered User.
Local time
Today, 22:45
Joined
Mar 17, 2003
Messages
27
Hi, all.
I need to know if i can add a control inside a form which is having 1 to many relationship with a subform. The control should prevent the subform from adding new record once the subform have been filled in.
Eg,
Tbl_request / Main form
Doc Date
1 - 12/5/4

Tbl_RequestDetail / Subform
ID Doc Code
1 - 1 - ItemA
2 - 1 - ItemB

* Once the subform has been filled, it should stop accepting entry next time i open it. If it's not filled, i can enter in the subfrom

Initially, i tried below code to accomplish that but it failed somehow.....
subform_current event
If (Me!Frm_requestDetail.form.recordset.count = 0 ) then
Me.AllowAdditions = True
Else
Me.AllowAdditions = False
End if

Can sombody to help?
Thanks a lot.
 

Users who are viewing this thread

Back
Top Bottom