If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Control Form form a Sub Form
How do I activate a command button on the main form when I double click on
the sub form? |
#2
|
|||
|
|||
Control Form form a Sub Form
"TonyAntique" u59027@uwe wrote in message news:a5a6118d13dbf@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. |
#3
|
|||
|
|||
Control Form form a Sub Form
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 |
#4
|
|||
|
|||
Control Form form a Sub Form
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@uwe wrote in message news:a5b1c09b9617b@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 |
#5
|
|||
|
|||
Control Form form a Sub Form
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/For...forms/201003/1 |
Thread Tools | |
Display Modes | |
|
|