473,396 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

If Then Else?

132 100+
I have a form that has several pages to it. On the first page I capture 2 sets of names....On the third page I need to display the names that appear on the first page...The user has the option to leave one of the sets of names blank on the first page....I want to query the field on the first page to determine if it is blank, if so I want to insert the second set of names on the third page...I'm utilizing the expression builder in the control source box, but am unable to get the syntax correct......

my fields on the first page are:
1) Member First; Member Last, Patient First, Patient Last. Member First and Last are required fields; Patient first and last ARE NOT. On the third page I want to insert the patient first and last IF if was entered on the form. If not, I want to insert the member first and last. How would I write the syntax to do this??
Apr 25 '07 #1
8 7151
Rabbit
12,516 Expert Mod 8TB
You can use iif(Expression, Value if True, Value if False)
Apr 25 '07 #2
Proaccesspro
132 100+
You can use iif(Expression, Value if True, Value if False)
Thanks for the reply...I saw this option, however I am having a hell of a time figuring the syntax to make it work. Would it be something like this?

Iif([member last]) <> null, [member last], [patient last])
Apr 25 '07 #3
Rabbit
12,516 Expert Mod 8TB
Almost, in a query or expression builder you would use "Is Not Null"
Apr 25 '07 #4
MMcCarthy
14,534 Expert Mod 8TB
Try this ...
Expand|Select|Wrap|Line Numbers
  1. IIf(Not IsNull([member last]),[member last],[patient last])
OR

Expand|Select|Wrap|Line Numbers
  1. IIf(IsNull([member last]),[patient last],[member last])
Apr 26 '07 #5
NeoPa
32,556 Expert Mod 16PB
Thanks for the reply...I saw this option, however I am having a hell of a time figuring the syntax to make it work. Would it be something like this?

Iif([member last]) <> null, [member last], [patient last])
If you needn't worry about the 'First' fields, then the easiest method is :
Expand|Select|Wrap|Line Numbers
  1. =Nz([Member Last], [Patient Last])
May 2 '07 #6
MMcCarthy
14,534 Expert Mod 8TB
If you needn't worry about the 'First' fields, then the easiest method is :
Expand|Select|Wrap|Line Numbers
  1. =Nz([Member Last], [Patient Last])
Clever Ade;)
May 2 '07 #7
Rabbit
12,516 Expert Mod 8TB
Clever Ade;)
Indeed. Very nice.
May 2 '07 #8
NeoPa
32,556 Expert Mod 16PB
If you DO need to worry about the 'First' fields, then please explain how they relate to the other fields.
If you need to get resulting strings using concatenation (&) then any tests for Null (IsNull() or Nz() will fail).

BTW Thanks Mary (& Rabbit).
May 2 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

33
by: Diez B. Roggisch | last post by:
Hi, today I rummaged through the language spec to see whats in the for ... else: for me. I was sort of disappointed to learn that the else clauses simply gets executed after the loop-body -...
6
by: Christian Seberino | last post by:
I am looking at the ELSE home page and trying to figure out if I should invest the time to learn about the ELSE minor mode for Emacs. Is there any programmer out there using ELSE that is getting...
27
by: Ron Adam | last post by:
There seems to be a fair amount of discussion concerning flow control enhancements lately. with, do and dowhile, case, etc... So here's my flow control suggestion. ;-) It occurred to me (a...
3
by: Patrice | last post by:
Hi, I need to do multi-conditional statements like below, but this error is displayed : Expected 'End' /myFilepath, line x else response.write(arrCorpo(sparam,sdiv)) end if I don't...
5
by: Brie_Manakul | last post by:
Is there a way in javascript to do an if else that shows a script in an iframe? Let me know if that doesn't make sense. We have a portal and in a portlet I need to grab these javascript links to...
4
by: Brie_Manakul | last post by:
I need to set up an if else to show different weather scripts based on the city selection they choose. Any help on this would be great. Thanks! <%@ page language="java" import="java.util.*,...
8
by: pelicanstuff | last post by:
Hi - Was wondering if anybody could tell me why this rather crappy code is giving me an 'Else without If' error on compile? All the Elses and Ifs look ok to me but there's a few. Private Sub...
23
by: bearophileHUGS | last post by:
So far in Python I've almost hated the 'else' of the 'for' loops: - I have problems to remember its meaning; - It gives me little problems when I later want to translate Python code to other...
17
by: JRough | last post by:
I'm trying to get error proof code. I have this code which seems to work but now I look at it I think it should be elseif not else and I wonder why it works. It is in the block:...
3
by: winson oo | last post by:
I don't know why it pop up this error when I want to compile the program. ( the problem of the souce code that I'm facing in in the bolder style. Thanks for checking! Private Sub...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.