dbTalk Databases Forums  

Re: Date record viewed...?

comp.databases.paradox comp.databases.paradox


Discuss Re: Date record viewed...? in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bill McCray
 
Posts: n/a

Default Re: Date record viewed...? - 04-04-2007 , 08:01 PM






On Wed, 04 Apr 2007 09:15:03 -0400, Kenneth
<usenet (AT) soleSPAMLESSassociates (DOT) com> wrote:

Quote:
Howdy,

I added a date field (called ViewDate) to a particular table
because I want a form that displays that table to behave in
the following way:

I wanted ViewDate to display today() whenever a record was
viewed (whether or not it was modified.)

The form is set up so that the cursor goes to a LastName
field when the form opens, and so, on the arrive of that
field, I just put in a line of code to modify ViewDate.

I set the arrive of LastName simply as:

edit()
ViewDate = today()
endEdit()

but then saw that I was in a continuous loop of locking, and
unlocking the record.

What is the proper way to approach this?
I had a similar problem recently. Here's the way I solved it.

* Declare a logical variable (I called it Flag) for the form.
* In the open method for the form, set Flag to False.
* Make your code

If not Flag Then
Flag = True
edit()
Viewdate = today()
endEdit()
Flag = False
EndIf

When you first enter this code, Flag is false, so you enter the Then
Clause. Flag is set. If this event is retriggered by code in the
Then Clause, Flag is now True, so the Then Clause does not execute.

Bill






----------------------------------------------------------------
Reverse halves of the user name for my e-address


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.