allow edits in sub form

S

SHETTY

Dear Friends

I have one sub form in my form

Whne I open main form allowedit will be disabled
subsequently if user want to modigy data they can press edit button in the
main form

following code associated with double click even of button
Private Sub Cmd_Edit_DblClick(Cancel As Integer)
Me.AllowEdits = True
BILL_ID.SetFocus
Cmd_Edit.Enabled = False
End Sub

sub form name is Frm_Billlog_Sub

please guide


Rgds

Ramesh Shetty
Manager(F&A)
 
J

John W. Vinson

following code associated with double click even of button
Private Sub Cmd_Edit_DblClick(Cancel As Integer)
Me.AllowEdits = True
BILL_ID.SetFocus
Cmd_Edit.Enabled = False
End Sub

sub form name is Frm_Billlog_Sub

You should use the Click event rather than DblClick for a button. If the
AllowEdits property of the subform is set to False (it needn't be, a subform
on a non-editable form will itself not be editable), use

Me!Frm_Billog_Sub.Form.AllowEdits = True

This assumes that the name of the Subform Control (the box which contains the
subform) is also named Frm_Billog_Sub; if not, view its name property in the
Properties and use that name.
 

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