Daily summary are must, good memory than rotten pen, well, a week did not take notes, recently busy PB, Hey East learn Western learning, the most terrible is the last Dora, spit trough about PB resources Why so little, today recorded is about ItemChanged event introduction.
Description:
The ItemChanged event occurs after the field in the DataWindow has been modified and loses focus, although this event is also triggered before the update function is called, and there are three parameters for the event:
Long row, which indicates when the forward
Dwobject Dwo, representing the field in DataWindow, example dwo.name = "Filedname"
String data, which means that new data, which is just entered
Return Values
0 (default) Receives data and shifts focus to the next line
1 reject input data, and focus does not shift
2 rejects the input of the data, but shifts the focus to the next line, and the data does not change, as before the modification
Precautions
This event is not triggered when the data window itself loses focus.
Sample
1: datetime lda_today//PB does not need ";", but in disconnect it needs ";" Difficult to understand
2: // today () PB system function, get day date; now () PB system function, get time
3: lda_today = DateTime (Today (), now ())
4: // equivalent to switch case but the grammatical similarities need to be noted
5: case Dwo.name
6: // field name
7: case "Stu_info_stu_birthdate"
8: //For judgment, control date, or input of other data
9: if datetime (data) > Lda_today Then
Ten: MessageBox ("Error!","date entered cannot exceed current date")
One : return 2
: if
:
: case "Stu_info_stu_enterdate"
:
: if datetime (data) > Lda_today Then
: MessageBox ("Error!","date entered cannot exceed current date")
: return 2
: if
: case"Stu_info_stu_phone"
: if len (data) < Then
: MessageBox ("Error!","Please enter the correct mobile number")
2 : return
: if
:
: case Else
:
: return 0
: End Choose
Passing by IS learning Pb, leave a fan bit, learn from each other!!!
PB Entry-itemchanged (long row,dwobject dwo,string data)