I have attached a small database called notes.
It has 5 fields
IDNUMBER Character 7
ACTIONDATE Date
FOLLOWUP Date
URGENT Logical
MEMO Memo
DATEADD Date
IDNUMBER is autoincremented, ACTIONDATE, URGENT and MEMO have the following commands in the CanWriteField event. FOLLOWUP can be changed and DATEADD is calculated.
dim tbl as p
dim mode as n
tbl = table.current()
mode = tbl.mode_get()
if mode = 1 then
ui_msg_box("WARNING","Changes cannot be made to this field")
cancel()
end if
The CanWriteField events do not work for MEMO.
The idea here is to only allow a person to change the FOLLOWUP field after the record has been saved. ACTIONDATE and URGENT will not allow changes in either form or browse mode. MEMO on the other can be edited and saved in browse mode, but not in form mode.
In the memo field, I also added a command to OnEditField event which is: ui_msg_box("ONEDIT","info") and to the CanEditField event which is: ui_msg_box("CANEDIT","info"). I added these to see when and how these events would fire.
If in form mode, an edit will not be allowed. When I type in a change and press SAVE, the WARNING message box comes up as it should. When I press the CANCEL button or ESC key, Alpha Five responds with 'Are you sure you want to lose your changes?'. I click 'Yes' and then the "CANEDIT" box comes up, I click OK and then ONEDIT message box comes up, I click OK, the CANEDIT message box comes up again, I click OK, the CANEDIT box comes up again, I click OK and then focus is given to the first field.
When in browse mode, the all the fields work the same except for the memo field. The ONEDIT and CANEDIT messages do not display and changes can be made at will.
I was told by Selwyn that events would fire in the memo field in version 6 and 7, not in version 5. I have tried this in version 6 and 7 using the latest updates and it does work. This was in a post a few days ago
So there are 2 questions. Why do memo field events fire in form mode, but not browse mode? Why does the ONEDIT and CANEDIT message display twice after the ESC is executed?
This little table is attached to a person served master file and needs to be manipulated through a browse which is in the person served form, not through a separate form. A sample is also attached.
Thanks,
mike
It has 5 fields
IDNUMBER Character 7
ACTIONDATE Date
FOLLOWUP Date
URGENT Logical
MEMO Memo
DATEADD Date
IDNUMBER is autoincremented, ACTIONDATE, URGENT and MEMO have the following commands in the CanWriteField event. FOLLOWUP can be changed and DATEADD is calculated.
dim tbl as p
dim mode as n
tbl = table.current()
mode = tbl.mode_get()
if mode = 1 then
ui_msg_box("WARNING","Changes cannot be made to this field")
cancel()
end if
The CanWriteField events do not work for MEMO.
The idea here is to only allow a person to change the FOLLOWUP field after the record has been saved. ACTIONDATE and URGENT will not allow changes in either form or browse mode. MEMO on the other can be edited and saved in browse mode, but not in form mode.
In the memo field, I also added a command to OnEditField event which is: ui_msg_box("ONEDIT","info") and to the CanEditField event which is: ui_msg_box("CANEDIT","info"). I added these to see when and how these events would fire.
If in form mode, an edit will not be allowed. When I type in a change and press SAVE, the WARNING message box comes up as it should. When I press the CANCEL button or ESC key, Alpha Five responds with 'Are you sure you want to lose your changes?'. I click 'Yes' and then the "CANEDIT" box comes up, I click OK and then ONEDIT message box comes up, I click OK, the CANEDIT message box comes up again, I click OK, the CANEDIT box comes up again, I click OK and then focus is given to the first field.
When in browse mode, the all the fields work the same except for the memo field. The ONEDIT and CANEDIT messages do not display and changes can be made at will.
I was told by Selwyn that events would fire in the memo field in version 6 and 7, not in version 5. I have tried this in version 6 and 7 using the latest updates and it does work. This was in a post a few days ago
So there are 2 questions. Why do memo field events fire in form mode, but not browse mode? Why does the ONEDIT and CANEDIT message display twice after the ESC is executed?
This little table is attached to a person served master file and needs to be manipulated through a browse which is in the person served form, not through a separate form. A sample is also attached.
Thanks,
mike
Comment