If Then Formula

G

Guest

I am trying to create an If Then formula that will populate a name when a
spefic checkbox is selected. The checkboxes are:

lobby
boardroom
training room

When one of these checkboxes is selected, I want the checkbox name to
appear. This is the formula that I created, but it is not working:
IIf( [lobby] =true, "Lobby" ) or IIf( [Training Room] =true, "Training Room"
) or IIf( [Boardroom] =true, "Boardroom" )

Instead of getting the word in () I am getting a value of -1 or 0. Please
help.
 
H

Hollis Paul

Instead of getting the word in () I am getting a value of -1 or 0. Please
help.
Stop with the formula stuff, it will drive you crazy! Do it in vbscript
using the appropriate syntax to access the check-box values, which will be 0
or 1, unless you have assigned them to a yes/no field.
 
G

Guest

I do not know how to write vbscript, what now?

Hollis Paul said:
Stop with the formula stuff, it will drive you crazy! Do it in vbscript
using the appropriate syntax to access the check-box values, which will be 0
or 1, unless you have assigned them to a yes/no field.
 
H

Hollis Paul

I do not know how to write vbscript, what now?
You don't know how to use the formula builder either, what then? And,
it is worth adding that not many people do.

The "what now" part is that your manager scrounges around his hidden
budget crevices and gets you some programming support. But what you
might do is search at www.outlookcode.com for some code examples of how
to schedule resources. And there are some forums there in which you
could also ask how other non-programmers have managed to schedule
resources.
 
G

Guest

I don't know if I explained my problem well. I have a form that I created and
the locations listed below are to be selected by the requestor using my form.
I want the location to populate on another tab in form, which is only used by
me. I want the location name to automatically populate on my part of the form.
 
H

Hollis Paul

I don't know if I explained my problem well. I have a form that I created and
the locations listed below are to be selected by the requestor using my form.
I want the location to populate on another tab in form, which is only used by
me. I want the location name to automatically populate on my part of the form.
Here is what I would do: I would not have the check-boxes bound to any field. I
will assume names for these controls: mycb1, mycb2,and mycb3. I would create
click_event handlers for these three controls, one for each:
Sub mycb1_click()

Set objPage = Item.GetInspector.ModifiedFormPages("My Page")
Set objControl = objPage.Controls("mycb1")
if objControl.Value = 1, then Item.BillingInformation = "lobby"
set objControl = Nothing

End Sub

Then, on the page where you want to display the selected value, bind the textbox
control to BillingInformation.

This, of course, assumes that you are not using BillingInformation for anything
else. Also, change the names I have used for the ones you have used. You enter
all this in the code editor when in design mode. It is in the tool bar, run
your pointer over all the buttons till you find the one that says code editor.

There is a forum at www.outlookcode.com for custom form design and programming.
You are now entering the wacky world of VBScript coding.

See the following pages:

Syntax for Microsoft Outlook property and control values and events
Correct syntax for accessing Microsoft Outlook property and control values and
writing events that respond to changes in properties or control values
URL: http://www.outlookcode.com/d/propsyntax.htm - 32KB - 10 May 2006

Controls on Microsoft Outlook Custom Forms
Tips, tricks and other resources for using controls on Microsoft Outlook forms
URL: http://www.outlookcode.com/d/formcontrols.htm - 36KB - 10 May 2006
 

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