Dumb question about frames...

orjazmik

New Member
I know this is probably going to be a really dumb, simple question... but this is how we learn, right? :D I have two frames defined in my procedure. Both are being used to update variables. I use an UPDATE statement for the user to update the first set of vairables, then use a second UPDATE statement to have the user input information into the second set of variable. In between the two UPDATE statements, I have something similar to the following:

if [last variable in set 1] not entered
then message "You have to fill in this field!"
view-as alert-box.

Everything works fine for the most part... the problem that I'm running into is that if the conditions are met to set off the if, then statement, I want it to place the user back on that last variable from set 1. Instead, it still displays and updates the next frame. I know there's something simple I'm missing here. Can anyone help me out? Thanks a lot...

- Marshall
 

Don Alexander

New Member
Try this for positioning cursor back to the desired field.

if field-name not entered then do:
message "you must enter this field"
view-as alert-box warning buttons ok.
apply "entry" to field-name in frame xxxx.
return no-apply.
end.

You MUST specify the frame name in the apply "entry" line.
This will override the normal tab behavior of the cursor and
return focus to the field specified (which does not have to
be the field tested or the last field the cursor was in).
 

orjazmik

New Member
I tried adding this statement, and now when I run the procedure. After getting the alert box, the procedure ends rather than taking me back to the variable I specify. Am I missing something here?

:confused:

Thanks again...

- Marshall
 

bendaluz2

Member
Or

You could do:
<pre>
update fill-in-1
validate(fill-in-1 <> "","You must enter this field").
</pre>
This will actually stop the field being left until it is filled in, which may be more (or less) useful in your particular situation

HTH
 

orjazmik

New Member
Re: Or

It doesn't look like that's working for me either. It's not allowing me to add the VALIDATE statement in parentheses within my UPDATE statement nor will it allow me to use the statement by itself against a variable (at least that's why I'm guessing it didn't work based on what the language refernce says). I appreciate the suggest though.

:confused:

- Marshall
 

Crittar

Member
I know this is a silly question:

You did remove the full stop at the end of the original update statement didn't you?
 

laa

Member
I tried the following code in 9.1C and it seemed to work fine.

DEFINE VARIABLE a AS CHARACTER.
DEFINE VARIABLE b AS CHARACTER.
DEFINE VARIABLE c AS CHARACTER.

FORM a b
WITH FRAME one.

FORM c
WITH FRAME two.

UPDATE a b VALIDATE(b NE "":U,"You have to fill in this field!")
WITH FRAME one.
UPDATE c
WITH FRAME two.

Is this what you were trying to accomplish?

Anne.
 

dwedgbury

New Member
try these:

1) define the first frame as "1 down".
2) if you are using "next-prompt", make sure you specify the frame i.e. next-prompt <field-name> with frame <first frame>
 

tdi

Progress Fan
Read this post in 5th place

This post in this thread is designed to be read after the 4th post:

How do you process the first frame, by way of a auto-end button?, check if it's not happening that you enter a condition that terminates your block process!
 
Top