View Single Post
  #2  
Old October 18th 06, 08:42 PM posted to microsoft.public.outlook.program_forms
Hollis Paul
external usenet poster
 
Posts: 242
Default Command Button on Read Page

In article . com,
wrote:
I have a form with a command button that I want to execute on the read
page when the message is received. (It is a workorder submission. The
command will add a record to an Access table). The command works just
fine on the Compose page when the new message is created. When the
message is sent and received the command no longer executes. I have
tried this several times on published forms and ofts. Has anyone seen
this behavior before?

I am betting that you designed your form in split mode, and dragged the
button from your compose page to your read page, thinking all the while
that you were getting the same control on the read page. Unfortunately,
this creates a completely new control, with a new name, and I believe,
no code behind it. So, the solution, if you want to keep the current
form, is to create a new click-event handler for the control on the read
page, and copy in the code from the click handler for the control on the
compose page, to the click handler for the control on the read page.

If you decide to redesign the form, as you are going back into design
mode anyway, then, get a new, blank form of the same type, and the first
thing you do, you uncheck the split forms option on the forms menu.
Then design all the elements that are common between the two pages.
Now, and only now, you split the form and design the unique elements for
each page.

However, I do notice that you never said you needed anything unique on
the compose or read page. If you don't have such a need, then, in
design mode, just uncheck the split-form option on the forms menu. It
will warn you that anything on the read page will be lost. Since you do
not need anything that is on the read page, say yes. Then, everything
you see in design mode, and when you compose a new instance of that
form, will also be visible when the message is read. I think this
practice of opening a message in split mode when you start the design
environment was a big mistake by Microsoft, and has led many unwary
designer into this very same problem.

HTH.

--
Hollis Paul
Mukilteo, WA USA


Ads