dbTalk Databases Forums  

Wierd Behavior in VP 6.0

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss Wierd Behavior in VP 6.0 in the comp.databases.xbase.fox forum.



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

Default Wierd Behavior in VP 6.0 - 11-13-2003 , 06:55 PM






Hi -

My experience has been in Programminf in FPW 2.6. SO maybe I am doing something
wrong.

I have a form and a table is added to the data environment of the form.

In the valid event of one of the controls, I have a code snippet. Everytime
the code is executed it 'grays out' or disables every other control on the
form. If I remove the code, it works just fine. The code snippet 'Seeks' a
record in the same table that has been added to the data environment. Would
that have something to do with this behavior?

Another question I had was - that based on the result of the code snippet I may
want to move focus back to the same control from where the code snippet was
executed. In other words if the code snippet determines that the data entered
in the text box was not valid, it should not allow the focus to move or the
user to tab to the next control. How do I achieve this.?

Thanks in advance

Reply With Quote
  #2  
Old   
Garrett Fitzgerald
 
Posts: n/a

Default Re: Wierd Behavior in VP 6.0 - 11-13-2003 , 07:19 PM






In article <20031113195525.29149.00000228 (AT) mb-m10 (DOT) aol.com>,
ShahJagat <shahjagat (AT) aol (DOT) com> wrote:
Quote:
I have a form and a table is added to the data environment of the form.

In the valid event of one of the controls, I have a code snippet. Everytime
the code is executed it 'grays out' or disables every other control on the
form. If I remove the code, it works just fine. The code snippet 'Seeks' a
record in the same table that has been added to the data environment. Would
that have something to do with this behavior?
Is the SEEK putting the record pointer at EOF? If so, that will cause
the other fields to be disabled.

Quote:
Another question I had was - that based on the result of the code
snippet I may
want to move focus back to the same control from where the code snippet was
executed. In other words if the code snippet determines that the data entered
in the text box was not valid, it should not allow the focus to move or the
user to tab to the next control. How do I achieve this.?
Return .F. or 0 from the Valid method of the textbox. .F. will show a
system-defined message, but 0 won't. Both will leave you in that
textbox. Make sure you leave some way to cancel out of the form,
though! :-)





Reply With Quote
  #3  
Old   
Dan Freeman
 
Posts: n/a

Default Re: Wierd Behavior in VP 6.0 - 11-14-2003 , 11:26 AM



One little thing Garrett left out.

"Remember" the current record number so you can return to it if the seek
fails.

lnRecno = Recno()
SEEK whatever
If Not Found()
Goto lnRecno
Endif

This will help make sure you don't land at EOF() if the seek fails.

Dan

"ShahJagat" <shahjagat (AT) aol (DOT) com> wrote

Quote:
Hi -

My experience has been in Programminf in FPW 2.6. SO maybe I am doing
something
wrong.

I have a form and a table is added to the data environment of the form.

In the valid event of one of the controls, I have a code snippet.
Everytime
the code is executed it 'grays out' or disables every other control on the
form. If I remove the code, it works just fine. The code snippet 'Seeks' a
record in the same table that has been added to the data environment.
Would
that have something to do with this behavior?

Another question I had was - that based on the result of the code snippet
I may
want to move focus back to the same control from where the code snippet
was
executed. In other words if the code snippet determines that the data
entered
in the text box was not valid, it should not allow the focus to move or
the
user to tab to the next control. How do I achieve this.?

Thanks in advance



Reply With Quote
  #4  
Old   
Garrett Fitzgerald
 
Posts: n/a

Default Re: Wierd Behavior in VP 6.0 - 11-14-2003 , 12:26 PM



In article <jf8tb.17926$G_1.12290 (AT) newssvr25 (DOT) news.prodigy.com>,
Dan Freeman <sbcdan (AT) dfapam (DOT) com> wrote:
Quote:
One little thing Garrett left out.

"Remember" the current record number so you can return to it if the seek
fails.

lnRecno = Recno()
SEEK whatever
If Not Found()
Goto lnRecno
Endif

This will help make sure you don't land at EOF() if the seek fails.
One other thing I left out: if you're just trying to look something
up, rather than do something with it, use the INDEXSEEK() function
with the parameter that says "Don't move the record pointer".


Reply With Quote
  #5  
Old   
ShahJagat
 
Posts: n/a

Default Re: Wierd Behavior in VP 6.0 - 11-14-2003 , 04:02 PM



Thanks everyone for the assistance and suggestions.This helps a lot..........

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.