Modify Event Procedure

L

Little Penny

Is it possible to modify the on click event procedure of a command
button of another form with a macro\vba command button from another
form? Just like changing the control properties of a form but for an
event procedure.
 
D

Damon Heron

Yes.
first make sure the first form is loaded, with something like this on your
second form's command button:

If Application.CurrentProject.AllForms!form1.IsLoaded Then
'refer to some dummy control on form1
Forms!form1!text1.Visible = False
end if

Then on your first form's command button click event,

if me.text1.visible then
'do something
else
'do something else (and set the textbox back to visible)

end if

Curious, tho, what is the reason for doing this?

Damon
 
L

Little Penny

After reading the replys I have changed my approach. I soory I did't
think of it in the first place

This is why this group is so valuable. It makes you think.


Thanks to all.
 

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