Calculated controls in forms

gtford

Registered User.
Local time
Today, 01:52
Joined
Apr 3, 2002
Messages
16
I have a data table which is essentially a to do list including a checkbox and a completion date. My form allows the user to check the item when complete and the system date is automatically entered into a calculated control. The problem is I don't know how to move the calculated date back into the data table into the completion date field. I'm a rookie so may not be asking this correctly, but I need to know how to move a calculated control in a form into a data table. Thanks.
 
If the field in the table is called CompletionDate and it is a field on your form then code like this in the After Update event of the Check box should do the trick:

If Me.CheckBoxName = True Then
Me.CompletionDate = Date
End if

I have assumed that checking the checkbox is what you want to trigger the code.

Be sure and change the names in the code to the actual names of your field and checkbox.

[This message has been edited by Jack Cowley (edited 04-03-2002).]
 
Jack, thanks for your help. I'll give it a try as soon as I get to the office tomorrow.
 
Jack, I tried your suggestion this morning and it worked perfectly.

Thanks.
 
Just a thought but you might want to make sure CompletionDate is Null first. Checkboxes are notorious for users clicking on them accidentally and when they go to fix it, they will be surprised to see the date change in that record from 1994 (or whatever).
...
If IsNull(Me.CompletionDate) Then Me.CompletionDate = Date
...

David R


[This message has been edited by David R (edited 04-04-2002).]
 

Users who are viewing this thread

Back
Top Bottom