Combo Box list problem

A

adammfellows

Hi,

I have a form that populates several combo boxes from an Excel
spreadsheet. This has worked correctly for some months now. However,
I recently removed an unrelated text box and have found that the combo
boxes are now blank and are not being populated.

I initially assumed that this had caused a problem and that I would
need to change some of the code. However, The strange thing is, if I
select the published form from the "Open forms" menu option in
Outlook, the combo boxes are blank, but if I then enter design mode
and then immediately run the form again, the combo boxes are now
populated correctly. Therefore I can't see what is wrong with the
form or code as such, since it does work if I run it in this way.

Any advice would be greatly appreciated!

Thanks very much,

Adam
 
S

Sue Mosher [MVP-Outlook]

If the form runs code when you use Run This Form in design mode, but doesn't run code after you have sent or saved an item using the published form, you probably have done something to "one-off" the form. Outlook will not run code on one-off forms; see http://www.outlookcode.com/d/secforms.htm for more information on this issue.

To ensure that a form does not one-off:

-- Make sure the "Send form definition with item" box on the (Properties) tab of the form is *not* checked. [1]

-- For in-house corporate use with Exchange Server, publish the form to the Organization Forms library or a public folder's forms library, as appropriate for your application.

-- For collaboration via the Internet, publish your form to your Personal Forms library. Save it as an .oft file and send it to other people who need to use it with instructions to publish it with the same form name that you used.

-- Set the Forward action on a custom form's (Actions) page to the published custom form.

Many other things can cause one-off forms. If the above steps don't work on a new item created with your form, see http://www.outlookcode.com/d/formpub.htm#oneoff for other possible causes.

[1] Whenever you publish a message form, Outlook will suggest that you may want to check the "Send form definition with item" box to ensure that the recipient will have the form, especially if you're sending to someone via the Internet. In the current Outlook security environment, this suggestion is obsolete. Ignore it unless your form has no code behind it.
 
A

adammfellows

Hi,

Thanks for your response. Would "one-offing" the form cause all the
code on all tabs to cease to work? The reason I ask is that there are
two tabs within the form and the code and combo boxes on the main
"message" form still work correctly, it is only those on a second tab
that are now blank. If "one-offing" causes all code to stop working
then I don't think that can be the cause of the problem, but if it is
specific to only one tab, then it could be the cause.

Thanks for your help,

Adam
 
S

Sue Mosher [MVP-Outlook]

Correct, a one-off form cannot run code at all. It that's not the problem, then you need to examine your code to determine why the code that sets the combo box is being skipped.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Thanks for your response. Would "one-offing" the form cause all the
code on all tabs to cease to work? The reason I ask is that there are
two tabs within the form and the code and combo boxes on the main
"message" form still work correctly, it is only those on a second tab
that are now blank. If "one-offing" causes all code to stop working
then I don't think that can be the cause of the problem, but if it is
specific to only one tab, then it could be the cause.


If the form runs code when you use Run This Form in design mode, but doesn't run code after you have sent or saved an item using the published form, you probably have done something to "one-off" the form. Outlook will not run code on one-off forms
 
A

adammfellows

Hi,

Now that it seems that it's not "one-offed" I will check through the
code and see what I can find. I'm still not sure why it works when I
run if using "Run this form" though, if the code is not correct. But
then, on the other hand, that would suggest it has "one-offed", but it
can't have because some of the code does run. All very confusing!

Thanks for your help,

Regards,

Adam
 

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