Discussion:
Altering data within datawindow when datawindow in querymode
(too old to reply)
mike chamanara
2003-07-23 21:21:39 UTC
Permalink
Hello all

I have this datawindow which has a field called ISBN, I have set this datawindow
in querymode and I need to scan in the ISBN numbers into
the DW for retrieval. The problem is that I only need the string
from third position to the tenth position, mid(isbn, 3, 10).
In itemchange event I am unable to change this field as its get inputed.

In another word, I need to alter this field before the 'Where' clause is
set for querymode to get executed.

dw_isbn.object.querymode='N'
dw_isbn.accepttext()
dw_isbn.retrieve()

I tried to change the data of this field within the itemchange event,
but I got errors in retrieval.

Any ideas.
---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp
2003-07-24 12:24:30 UTC
Permalink
Itemchanged event is fired for every change on the dw and you need to filter
the validation only for the isbn column. You need to "Reject the data value
but allow the focus to change" with a return of 2.

you might want to write the following in itemchanged event......

string myval

if dwo.name = "isbn" then
myval = mid(data, 3, 10)
This.SetItem(row, "isbn", myval)
this.settext(myval)
return 2
end if

good luck
WS
Post by mike chamanara
Hello all
I have this datawindow which has a field called ISBN, I have set this datawindow
in querymode and I need to scan in the ISBN numbers into
the DW for retrieval. The problem is that I only need the string
from third position to the tenth position, mid(isbn, 3, 10).
In itemchange event I am unable to change this field as its get inputed.
In another word, I need to alter this field before the 'Where' clause is
set for querymode to get executed.
dw_isbn.object.querymode='N'
dw_isbn.accepttext()
dw_isbn.retrieve()
I tried to change the data of this field within the itemchange event,
but I got errors in retrieval.
Any ideas.
---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp
Mike Chamanara
2003-07-28 20:00:51 UTC
Permalink
Thanks for your response,

But the problem is that when the DW is in querymode
the itemchange event will not be able to execute the
setitem event. When I display the messagebox("sql",sqlsyntax)
within sqlpreview event. The ISBN number is the original number
that I have entered.

Lets say that the DW is in query mode:

1) The focus in on ISBN field.
2) you enter 1234567890123 and you tab out of the field
3) the itemchange event is execute and assign the mayval='4567890123'
4) when the querymode is set to 'N' and the sqlmessage is displayed
the where clause is still looking for isbn = '1234567890123'

Thanks again

Loading...