Tim L
Registered User.
- Local time
- Today, 01:49
- Joined
- Sep 6, 2002
- Messages
- 414
This is a problem of transferring text between two forms and getting a control to update, I've posted this here because I suspect that the answer lies in VBA and not the form...
I have a "comments" text box (memo field) on a form, which is locked. Operators are allowed to add more comments, but for each comment the current date and time are to be included, and are added automatically. To (try and) keep things simple, when the operator clicks on an Add Comments button a pop-up form opens and (using OpenArgs) is passed the current comment.
The operator types in their additional comments, can preview the changes and cancel the operation if they are not happy. If they are happy with the modified comments they click on a 'Transfer' button, this is where the fun begins...
Currently I have a global string, globalStrComment, into which I copy the updated comment. I then have to then get the operator to click on a control on the form to update the value, it won't work in the OnActivate or GotFocus events I want things to be automatic because if the operator moves away from the form before clicking on the control the field is not updated.
I thought about using a Function to get the updated comment (, call func with textbox.value, open the form passing original comment, While-End until the form closes, updating the global string in the process, then return the value global string from the function) however this just, I suppose unsurprisingly, causes the program to hang.
So,
1) How can I get the field on the calling form to update as soon as the Add Comments form is closed (I may wish to reuse the add comments form elsewhere) ? and,
2) How can I get the visible contents of the control to be updated automatically and at the same time?
This one is proving a challenge to me but I'm fairly certain that someone out there must have done something similar, so are there any other suggestions?
Yours, in anticipation,
Tim
I have a "comments" text box (memo field) on a form, which is locked. Operators are allowed to add more comments, but for each comment the current date and time are to be included, and are added automatically. To (try and) keep things simple, when the operator clicks on an Add Comments button a pop-up form opens and (using OpenArgs) is passed the current comment.
The operator types in their additional comments, can preview the changes and cancel the operation if they are not happy. If they are happy with the modified comments they click on a 'Transfer' button, this is where the fun begins...
Currently I have a global string, globalStrComment, into which I copy the updated comment. I then have to then get the operator to click on a control on the form to update the value, it won't work in the OnActivate or GotFocus events I want things to be automatic because if the operator moves away from the form before clicking on the control the field is not updated.
I thought about using a Function to get the updated comment (, call func with textbox.value, open the form passing original comment, While-End until the form closes, updating the global string in the process, then return the value global string from the function) however this just, I suppose unsurprisingly, causes the program to hang.
So,
1) How can I get the field on the calling form to update as soon as the Add Comments form is closed (I may wish to reuse the add comments form elsewhere) ? and,
2) How can I get the visible contents of the control to be updated automatically and at the same time?
This one is proving a challenge to me but I'm fairly certain that someone out there must have done something similar, so are there any other suggestions?
Yours, in anticipation,
Tim