Solved

Simple If Formula Question

Posted on 1998-12-07
4
251 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now