Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Simple If Formula Question

Posted on 1998-12-07
4
273 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

837 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