General information
Category:
Forms & Form designer
Title:
Return .f. still allows exit from field. Why?
I use the following general form pretty widely:
action=messagebox('Do you really mean this?',259,'Daft Entry in Field')
if action <>6
return .f.
endif
which works happily enough in most situations but I have just tested a new text box and found it refusing to work. It asks the question, accepts 'No' for an answer, returns .f. and then blithely allows the focus to move to the next field.
here is the precise code:
if not IgnorePaymentTomorrow
if this.value=date()+1
action=messagebox("You have entered Tomorrow's date - "+dtoc(thisform.paydate)+chr(13);
+'Is this what you really meant?',259,'Payment Tomorrow!')
if action<>6
return .f.
endif
action=messagebox("Are you likely to enter further Payments (during this session) with Tomorrow's date?",259,'More Tomorrows?')
if action=6
ignorePaymentTomorrow=.t. && don't irritate the user if they've already told us they're entering more like this
endif
endif
endif
the debugger shows that answering No correctly make 'action' =7 and the code runs the 'return .f.' line and exits the valid but moves directly to the lostfocus rather than back to the setfocus.
any ideas?
Harry
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only