[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Simple If Formula Question

Posted on 1998-12-07
4
Medium Priority
?
296 Views
Last Modified: 2013-12-18
I have a form that has a set of fields, of type number, that need to be set to zero, if the user doesn't enter a number.  I just wanted to write a formula on QuerySave to accomplish this.  Here's what I did:

fldLocationIP1 = @If(fldLocationIP1 = ""; "0"; fldLocationIP1)

What might be wrong with this?
TIA!
0
Comment
Question by:IsleOfView
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:wrichard
ID: 1117759
Try these simple changes...
fldLocationIP1 := @If(fldLocationIP1 = ""; 0; fldLocationIP1)

You could also place this formula in the default value so that each field is automatically set to 0
0
 

Author Comment

by:IsleOfView
ID: 1117760
When I put that into the QuerySave event, I get the following error (when attempting to save the formula):

No main or selection expression in formula "

Any ideas?
0
 
LVL 1

Accepted Solution

by:
wrichard earned 30 total points
ID: 1117761
On the last line of the formula put
select @all
0
 

Author Comment

by:IsleOfView
ID: 1117762
Thanks for trying, but that didn't work either.

Here's what I finally got to work.  I placed the following code in the InputValidation event for each field I needed checked:

FIELD fldLocationIP1:=fldLocationIP1;
@If(fldLocationIP = ""; @Failure(@SetField("fldLocationIP1"; 0)); @Success)

That seems to do the trick!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question