AllowAddition in Subform

naungsai

Abecedarian
Local time
Today, 16:48
Joined
Sep 8, 2008
Messages
123
Dear Friends:)

I have a subform, the content of which will be manipulated conditionally. If in the main form, the txtUserName and the txtStaff are equal, the content in the subform can be edit, delete and add new record. I used the following code to do this.
Private Sub Form_Current()
Me.Refresh
If Forms!RDQA!txtUserName = Forms!RDQA!txtStaff Then
Me.AllowEdits = True
Me.AllowDeletions = True
Me.AllowAdditions = True

Else
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = False
End If
End Sub

All works well. but the problem is when I add new record in the main form, (txtUserName and txtStaff are equal) the New Row does not appear in the subform.
How should I solve it?

Thanks in advance
 
Check this link for the correct syntax for referring to Forms/Subforms from various relative locations and see if that helps.
 
Dear John

Thanks for your quick reply. I have check it. I think it is correct.
In my form, it works well in "AllowEdits" and "AllowDeletions". But for "AllowAdditions", although the "txtUserName" and "txtStaff" are equal, new records row does not appear in the subform.
Thanks again.
 

Users who are viewing this thread

Back
Top Bottom