first of all.... I think you post this one in the wrong forum...
but to get back to your thingy!
Give the controle (button) a name. this should make it possible to do something like:
currform.contolename.enable := true or false;
if you would like to disable the button when a order is released you could do something like this :
currform.contolename.enable := status = status::released;
or maybe the oppicide? Disable when not released :
currform.contolename.enable := status <> status::released;
you will have to program this like in a function and call this funtion from 3 triggers on your form.
1.) The OnOpenForm trigger.
2.) The OnAfterGetRecord (or OnAfterGetCurrentRecord)
3.) The OnValidate trigger of the Status field.
1, so the form will enable or disable the button when openening the form
2, so the button will have the correct status when you scroll though the records
3, so the button wil have the right status when you will change the status field in the header...
you dig?
"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."
Comments
but to get back to your thingy!
Give the controle (button) a name. this should make it possible to do something like:
currform.contolename.enable := true or false;
if you would like to disable the button when a order is released you could do something like this :
currform.contolename.enable := status = status::released;
or maybe the oppicide? Disable when not released :
currform.contolename.enable := status <> status::released;
you will have to program this like in a function and call this funtion from 3 triggers on your form.
1.) The OnOpenForm trigger.
2.) The OnAfterGetRecord (or OnAfterGetCurrentRecord)
3.) The OnValidate trigger of the Status field.
1, so the form will enable or disable the button when openening the form
2, so the button will have the correct status when you scroll though the records
3, so the button wil have the right status when you will change the status field in the header...
you dig?
If it was hard to write, it should be hard to understand."
Thanks for the help, the button enabling and disabling is now working.
I will try to ensure that I post in the relevant forum next time......
Best Regards
David