From: TonyAntique on
How do I activate a command button on the main form when I double click on
the sub form?

From: Allen Browne on
"TonyAntique" <u59027(a)uwe> wrote in message news:a5a6118d13dbf(a)uwe...
> How do I activate a command button on the main form when I double click
> on the sub form?

The code would be like this:
Me.Parent!Command99.Enabled = True

But you'll need to define "double-click on the subform" more precisely. It's
probably the dblClick event of the subform's Detail section you want to use.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

From: TonyAntique via AccessMonster.com on
Allen many thanks.
I am sorry I wasn't precise enough .
Me.Parent!Command99.Enabled = True will make it active or not (True or False)
but I wanted to trigger the command button from the sub form.
Me.Parent!Command99_Click causes Run-time error'438' not supported.

I'm sure the answer is simple but I just can't find it!

Allen Browne wrote:
>> How do I activate a command button on the main form when I double click
>> on the sub form?
>
>The code would be like this:
> Me.Parent!Command99.Enabled = True
>
>But you'll need to define "double-click on the subform" more precisely. It's
>probably the dblClick event of the subform's Detail section you want to use.
>

--
Message posted via http://www.accessmonster.com

From: Douglas J. Steele on
Allen told you how to enable a command button on the parent form, not how to
run the code associated with the button's Click event.

To have it call the code, you'd need

Call Me.Parent.Command99_Click

Note that you'll need to change the declaration for Command99_Click from

Private Sub Command99_Click()

to

Public Sub Command99_Click()

Incidentally, do yourself a HUGE favour, and start renaming your controls so
that they're more meaningful.


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"TonyAntique via AccessMonster.com" <u59027(a)uwe> wrote in message
news:a5b1c09b9617b(a)uwe...
> Allen many thanks.
> I am sorry I wasn't precise enough .
> Me.Parent!Command99.Enabled = True will make it active or not (True or
> False)
> but I wanted to trigger the command button from the sub form.
> Me.Parent!Command99_Click causes Run-time error'438' not supported.
>
> I'm sure the answer is simple but I just can't find it!
>
> Allen Browne wrote:
>>> How do I activate a command button on the main form when I double click
>>> on the sub form?
>>
>>The code would be like this:
>> Me.Parent!Command99.Enabled = True
>>
>>But you'll need to define "double-click on the subform" more precisely.
>>It's
>>probably the dblClick event of the subform's Detail section you want to
>>use.
>>
>
> --
> Message posted via http://www.accessmonster.com
>


From: TonyAntique via AccessMonster.com on
Thanks

Douglas J. Steele wrote:
>Allen told you how to enable a command button on the parent form, not how to
>run the code associated with the button's Click event.
>
>To have it call the code, you'd need
>
> Call Me.Parent.Command99_Click
>
>Note that you'll need to change the declaration for Command99_Click from
>
>Private Sub Command99_Click()
>
>to
>
>Public Sub Command99_Click()
>
>Incidentally, do yourself a HUGE favour, and start renaming your controls so
>that they're more meaningful.
>
>> Allen many thanks.
>> I am sorry I wasn't precise enough .
>[quoted text clipped - 15 lines]
>>>probably the dblClick event of the subform's Detail section you want to
>>>use.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201003/1