IF Statement help

*Pete*

Registered User.
Local time
Today, 02:52
Joined
Jul 17, 2006
Messages
40
Help!!

I'm having real problems with forms in word... I have a drop down list named Dropdown1. I have a text box called Text1 with the function:

{if Dropdown1="A" "Y" "N"}

Whatever i try to do with this it will not display the correct result.

Can anyone help or point me in the direction of a good Word tutorial using IF() Statements.

Kind Regards

Pete
 
Don't you need commas between the parameters?
 
Yeah, i tried that but it did not work.
 
Try this...from the MS Office 2003 site...

It looks like if you enclose your dropdown box name in parens, it should work...hope this helped!:cool:

"The IF field (field: A set of codes that instructs Microsoft Word to insert text, graphics, page numbers, and other material into a document automatically. For example, the DATE field inserts the current date.) performs one of two alternative actions, depending on a condition you specify. For example, the statement "If the weather is sunny, we'll go to the park; if not, we'll go to the movies" specifies a condition that must be met (sunny weather) for a certain action to take place (going to the park). If the condition is not met, an alternative action occurs (going to the movies).

The following IF field is a similar type of statement. If the current data record (data record: A complete set of related information that corresponds to one row of information in the data source. All information about one client in a client mailing list is an example of a data record.) contains "San Francisco" in the City field, Microsoft Word prints the first text in quotation marks in the merged document that results from that data record. Otherwise, Word prints the second set of text. This example uses the IF and MERGEFIELD fields together.

{ IF { MERGEFIELD City } = "San Francisco" "Please call our local office." "Please return the enclosed form in the provided envelope." }

Word inserts an IF field in this form when you click the Insert Word Field button on the Mail Merge toolbar (toolbar: A bar with buttons and options that you use to carry out commands. To display a toolbar, press ALT and then SHIFT+F10.) and then click If...Then...Else.

Here are some examples of ways to modify the IF field codes (field code: Placeholder text that shows where specified information from your data source will appear; the elements in a field that generate a field's result. The field code includes the field characters, field type, and instructions.) by using them in concert with other field codes:

Compare a data field with another data field or bookmark

This IF field compares the number in the Rate data field (data field: A category of information that corresponds to one column of information in a data source. The name of each data field is listed in the first row (header row) of the data source. "PostalCode" and "LastName" are examples of data field names.) with the number in the Discount data field. If the numbers are equal, the specified text is printed.

{ IF { MERGEFIELD Rate } = { MERGEFIELD Discount } "We will offer you a larger discount. " " " }

(If number in the Rate data field does not equal the number in the Discount field, no text is printed.)

Insert other Word fields into an IF field

Example 1
If the condition specified by this IF field is met, the INCLUDETEXT field inserts the contents of the indicated document. To specify the location and file name of the included document, use double backslash (\\) characters, as shown in the example. If the condition is not met, Word inserts the AutoText entry "Copyright."

{ IF { MERGEFIELD State } = "NY" "{ INCLUDETEXT c:\\worddocs\\contract.doc }" "{ AUTOTEXT Copyright }" }

Example 2
If the Company data field for a data record contains any information — that is, if the field is not blank — Word prints text from the CompanyAddress field. Otherwise, Word prints text from the HomeAddress field.

{ IF { MERGEFIELD Company } <> " " "{ MERGEFIELD CompanyAddress }" "{ MERGEFIELD HomeAddress }" }"
 
help

i need some help with IF statements in access. I have been asked to set up a query to calculate total duration in additional learning support.

the scenario is if the number of hours is less than 13 then that student is in band one. and if its greater than 13 its band two and so on. This is what my formula looks like so far:

=IIf([Total Duration]="13<","Band One","Band Two")

can you notify me of any problems why it may not be working
 
Wow talk about dredging up an old thread, kudo's for trying to search. But why if you want to know something about access, use the word forum?

=IIf([Total Duration]<13,"Band One","Band Two")
 

Users who are viewing this thread

Back
Top Bottom