Database - functionality for front end application

Melvin Cox melcox at
Fri Nov 21 02:54:13 EST 2003


I have successfully implemented each of your suggestions.

The only change I have made is in the script of the field "Affilitation" 
(all caps, length limited to 10 characters).

The closeField handler will not work when the script includes the keyDown 
and Capitalize handlers.  The Capitalize handler changes the field's 
contents using a put statement.

I have therefore substituted an exitField handler and used an if statement 
and a local variable to compare the field's current value to the value of 
the field at the time an openField handler was triggered.

My script liike like:


--declare a local variable 'saved'

local saved

--place the current value of the affiliation field into the 'saved' variable

on openField
  put field "affiliation" into saved
end openField

--when leaving the affiliation field, compare current value to the 'saved' 
--if value has changed, trigger updates to the Company Name and Last Update 

on exitField
  if field "affiliation" <> saved
    pass exitField
  end if
end exitField

--limit field to 10 characters and insure capitalization

on keyDown pWhichKey
  if the length of me >= 10 then beep
    send "Capitalize" to me in 5 milliseconds
    pass keyDown
  end if
end keyDown

on Capitalize
  put the selectedChunk of me into tChunk
  put upper(me) into me
  select tChunk
end Capitalize


Many thanks for pointing the way forward!


Melvin Cox

----Original Message Follows----
From: Jan Schenkel <janschenkel at>
Reply-To: How to use Revolution <use-revolution at>
To: How to use Revolution <use-revolution at>
Subject: Re: Database - functionality for front end application
Date: Mon, 17 Nov 2003 21:58:05 -0800 (PST)
MIME-Version: 1.0
Received: from ([]) by 
with Microsoft SMTPSVC(5.0.2195.6713); Mon, 17 Nov 2003 21:59:19 -0800
Received: from ([]) by with 
Microsoft SMTPSVC(5.0.2195.6713); Mon, 17 Nov 2003 21:58:20 -0800
Received: from (localhost [])by 
(Postfix) with ESMTPid 3678F930084; Tue, 18 Nov 2003 00:56:42 -0500 (EST)
Received: from 
([])by (Postfix) with 
SMTP id 018FE93005Ffor <use-revolution at>;Tue, 18 Nov 2003 
00:56:40 -0500 (EST)
Received: from [] by via HTTP;Mon, 17 
Nov 2003 21:58:05 PST
X-Message-Info: KtxBqYfPyq2nieRMDaD/YSso4X0bxA4j
Delivered-To: use-revolution at
Message-ID: <20031118055805.52586.qmail at>
In-Reply-To: <Law10-F169oOesurQZ8000100a5 at>
X-BeenThere: use-revolution at
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: How to use Revolution <>
<>,<mailto:use-revolution-request at>
List-Archive: <>
List-Post: <mailto:use-revolution at>
List-Help: <mailto:use-revolution-request at>
<>,<mailto:use-revolution-request at>
Sender: use-revolution-bounces at
Errors-To: use-revolution-bounces at
Return-Path: use-revolution-bounces at
X-OriginalArrivalTime: 18 Nov 2003 05:58:20.0703 (UTC) 

Hi Melvin,

Good to see you got a lot further already ; now let's
refine the earlier solution a bit.
Add the following handler to the card script :
on UpdateCompanyName
   put "SELECT * FROM Business WHERE Bid=" \
       into tSQLQuery
   put "'" & field "affiliation" & "' ;" after \
   revSetSQLOfQuery "AffiliatedBusiness", tSQLQuery
end UpdateCompanyName
[Note that I've replaced the quotes surrounding the
field content with single quotes and ended with a
space and a semicolon, so that the query will also
work on FileMaker and other 'picky' databases.]

To somewhat clean up your scripts, you can now change
the script of the navigation group to :
on mouseUp
end mouseUp

Now change the closeField handler in the script of the
field "Affilitation" to :
on closeField
   pass closeField
end closeField
The 'pass' command will allow the closeField message
to traverse the controls down the message path, so in
our case, the closeField in the card script will also
be invoked, and thus update the timestamp.

Hope this helped,

Jan Schenkel.

"As we grow older, we grow both wiser and more foolish at the same time."  
(La Rochefoucauld)

Is there a gadget-lover on your gift list?  MSN Shopping has lined up some 
good bets!

More information about the Use-livecode mailing list