By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,171 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

VB calling a form/subform by name rather then me.formname

P: n/a
I have the statment below that turns off allow edits so thatwhen I run
the commend acCmdFind I only see the find menu rather then find and
replace.

The search button is on the parent form, however there is a subform too
and when I am in the subform this procedure doesnt work.

How can I have modify Me.AllowEdits=false to point to both the parent
and the subform by name? the parents form name is frm_pe and the
subforms name is frm_pe_user

If Me.AllowEdits = True Then
Me.AllowEdits = False

DoCmd.RunCommand acCmdFind

Me.AllowEdits = True
Me.Parent.AllowEdits = True

Else
DoCmd.RunCommand acCmdFind
End If

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
A subform's form name is not a unique identifier for an open object because
the same suform may be open in multiple forms. YOu can refer to a subform
through the parent form and the name of the subform -control- that contains
the subform, though.

Forms!<parentformname>!<subformctrlname>.Form

If you tell us what you're actually trying to accomplish, we may be able to
give you more helpful information.

On 30 Apr 2005 15:56:31 -0700, td*******@yahoo.com wrote:
I have the statment below that turns off allow edits so thatwhen I run
the commend acCmdFind I only see the find menu rather then find and
replace.

The search button is on the parent form, however there is a subform too
and when I am in the subform this procedure doesnt work.

How can I have modify Me.AllowEdits=false to point to both the parent
and the subform by name? the parents form name is frm_pe and the
subforms name is frm_pe_user

If Me.AllowEdits = True Then
Me.AllowEdits = False

DoCmd.RunCommand acCmdFind

Me.AllowEdits = True
Me.Parent.AllowEdits = True

Else
DoCmd.RunCommand acCmdFind
End If


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.