|
|
Can I store the date/time the combo box entry was selected in the tag property and read this value later. E.g. Me!cmbBox.tag = Now() Is there any reason why this would not work? In the form before update event, I need to know the exact time when the combo box was last changed.
-- Dorian "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime".
|
|
"Dorian" <Dorian[ at ]discussions.microsoft.com> wrote in message news:1F7D5DF6-8A2E-4FDA-822B-6FBDE07ED2EE[ at ]microsoft.com...
[Quoted Text] > Can I store the date/time the combo box entry was selected in the tag > property and read this value later. E.g. > Me!cmbBox.tag = Now() > Is there any reason why this would not work? > In the form before update event, I need to know the exact time when the > combo box was last changed.
I don't see why it would not work, so long as you're talking about doing this within the same editing session (between opening and closing the form). Bear in mind that the Tag property is a text property, so you'll probably need to convert it back to the Date data type (using the CDate() function, probably) for comparisons with Now().
Would you need to be sure to clear the Tag property in the form's Current event, to make sure it's fresh for each new record?
It seems to me you could, alternatively, also use a module-level variable or a hidden text box on the form for this purpose.
I'm curious. What is the need behind this request? I've never encountered a similar question.
-- Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup)
|
|
This is a ticketing system and the combo box represents the team to whom the ticket is assigned. This form also allows the ticket to be emailed out to the team. The user wants an 'email reminder' when a ticket agent forgets to email the team the ticket. So I need to capture when the last email was sent and compare it to when the assigned team was changed to determine if the email was sent before or after the team was changed. If it was not sent after then this triggers the email alert (in the Form before update event).
-- "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime".
"Dirk Goldgar" wrote:
[Quoted Text] > "Dorian" <Dorian[ at ]discussions.microsoft.com> wrote in message > news:1F7D5DF6-8A2E-4FDA-822B-6FBDE07ED2EE[ at ]microsoft.com... > > Can I store the date/time the combo box entry was selected in the tag > > property and read this value later. E.g. > > Me!cmbBox.tag = Now() > > Is there any reason why this would not work? > > In the form before update event, I need to know the exact time when the > > combo box was last changed. > > > I don't see why it would not work, so long as you're talking about doing > this within the same editing session (between opening and closing the form). > Bear in mind that the Tag property is a text property, so you'll probably > need to convert it back to the Date data type (using the CDate() function, > probably) for comparisons with Now(). > > Would you need to be sure to clear the Tag property in the form's Current > event, to make sure it's fresh for each new record? > > It seems to me you could, alternatively, also use a module-level variable or > a hidden text box on the form for this purpose. > > I'm curious. What is the need behind this request? I've never encountered > a similar question. > > -- > Dirk Goldgar, MS Access MVP > www.datagnostics.com > > (please reply to the newsgroup) > >
|
|
This would only be good for one combo box (not PER RECORD). So that combo would have the last change regardless of which record your users had done. That doesn't seem right to me based on your description of what you are looking for. I would use an additional field in the table to store that information for THAT record. -- Bob Larson Free Tutorials and Samples at http://www.btabdevelopment.com
__________________________________
"Dorian" wrote:
[Quoted Text] > Can I store the date/time the combo box entry was selected in the tag > property and read this value later. E.g. > Me!cmbBox.tag = Now() > Is there any reason why this would not work? > In the form before update event, I need to know the exact time when the > combo box was last changed. > > -- Dorian > "Give someone a fish and they eat for a day; teach someone to fish and they > eat for a lifetime".
|
|
"Dorian" <Dorian[ at ]discussions.microsoft.com> wrote in message news:1967F3C7-8E12-4DBB-B33A-691054DADEBD[ at ]microsoft.com...
[Quoted Text] > This is a ticketing system and the combo box represents the team to whom > the > ticket is assigned. This form also allows the ticket to be emailed out to > the > team. > The user wants an 'email reminder' when a ticket agent forgets to email > the > team the ticket. So I need to capture when the last email was sent and > compare it to when the assigned team was changed to determine if the email > was sent before or after the team was changed. If it was not sent after > then > this triggers the email alert (in the Form before update event).
I'm probably not imagining this very well. What happens if the the user selects the wrong value in the combo box, then attempts to correct it but selects another wrong value, then finally selects the right value? Does that scenario break anything?
If the only thing that matters is what team is selected when the record is saved (form BeforeUpdate or AfterUpdate event), then wouldn't it make sense to record the sending of the e-mail, including the date/time and to whom it was sent, and then just check in the form AfterUpdate event to see if an e-mail has been sent? Maybe then, if an e-mail has already been sent to a different team, you would then automatically send a cancellation e-mail to that team as well as an assignment e-mail to the new team.
I suspect I'm missing something.
-- Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup)
|
|
I only need this for one combo box and the value is not stored - it's just neeeded for comparison with another date/time in the form BeforeUpdate event. The tag will be initialized in the form current event.
-- Dorian "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime".
"Dorian" wrote:
[Quoted Text] > Can I store the date/time the combo box entry was selected in the tag > property and read this value later. E.g. > Me!cmbBox.tag = Now() > Is there any reason why this would not work? > In the form before update event, I need to know the exact time when the > combo box was last changed. > > -- Dorian > "Give someone a fish and they eat for a day; teach someone to fish and they > eat for a lifetime".
|
|
I don't think wrong combo box selections will matter. The tag date/time will only be set if the value <> oldvalue and so long as the final selection is right, the date/time will be recorded. The date/time the assignment is done is critical to compare with when the last email was sent. The application does not store to whom the last email was sent - that might be a good idea though. This is one change I thought was going to be simple but has opened several cans of worms. -- Dorian "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime".
"Dirk Goldgar" wrote:
[Quoted Text] > "Dorian" <Dorian[ at ]discussions.microsoft.com> wrote in message > news:1967F3C7-8E12-4DBB-B33A-691054DADEBD[ at ]microsoft.com... > > This is a ticketing system and the combo box represents the team to whom > > the > > ticket is assigned. This form also allows the ticket to be emailed out to > > the > > team. > > The user wants an 'email reminder' when a ticket agent forgets to email > > the > > team the ticket. So I need to capture when the last email was sent and > > compare it to when the assigned team was changed to determine if the email > > was sent before or after the team was changed. If it was not sent after > > then > > this triggers the email alert (in the Form before update event). > > > I'm probably not imagining this very well. What happens if the the user > selects the wrong value in the combo box, then attempts to correct it but > selects another wrong value, then finally selects the right value? Does > that scenario break anything? > > If the only thing that matters is what team is selected when the record is > saved (form BeforeUpdate or AfterUpdate event), then wouldn't it make sense > to record the sending of the e-mail, including the date/time and to whom it > was sent, and then just check in the form AfterUpdate event to see if an > e-mail has been sent? Maybe then, if an e-mail has already been sent to a > different team, you would then automatically send a cancellation e-mail to > that team as well as an assignment e-mail to the new team. > > I suspect I'm missing something. > > -- > Dirk Goldgar, MS Access MVP > www.datagnostics.com > > (please reply to the newsgroup) > >
|
|
"Dorian" <Dorian[ at ]discussions.microsoft.com> wrote in message news:C566AC0A-FBCC-4404-A418-645472144D6D[ at ]microsoft.com...
[Quoted Text] >I don't think wrong combo box selections will matter. The tag date/time >will > only be set if the value <> oldvalue and so long as the final selection is > right, the date/time will be recorded. > The date/time the assignment is done is critical to compare with when the > last email was sent. The application does not store to whom the last email > was sent - that might be a good idea though. > This is one change I thought was going to be simple but has opened several > cans of worms.
Have you reached a resolution on this? Is it now working the way you want?
-- Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup)
|
|
|