|
|
Update a date/time control when check box control is updated
I have two columns in tbl.Jobs. One field is a bit data type that I named
Jobs.OnHold and the control on the form is a check box. I also have a
date/time field named HoldDate. I want the hold date field to automatically
udpate with the current date everytime the check box control is udpated. What
is the best way to accomplish this?
|
|
0
|
|
|
|
Reply
|
Utf
|
2/15/2008 5:41:03 PM |
|
Use the After Update event of the check box control:
Me.txtHoldDate = Date
--
Dave Hargis, Microsoft Access MVP
"BrianP" wrote:
> I have two columns in tbl.Jobs. One field is a bit data type that I named
> Jobs.OnHold and the control on the form is a check box. I also have a
> date/time field named HoldDate. I want the hold date field to automatically
> udpate with the current date everytime the check box control is udpated. What
> is the best way to accomplish this?
|
|
0
|
|
|
|
Reply
|
Utf
|
2/15/2008 6:26:00 PM
|
|
Thanks Dave, I should have remembered that one.
|
|
0
|
|
|
|
Reply
|
Utf
|
2/15/2008 11:40:00 PM
|
|
I have a similar question. I have a field called "Sold" which is a check box.
When I check it I want the field "Date of Sale" to automatically fill in
with todays date. I understand going to the "after update event" but I don't
know what code to write.
Hope you can help. Thank you
"Klatuu" wrote:
> Use the After Update event of the check box control:
>
> Me.txtHoldDate = Date
>
> --
> Dave Hargis, Microsoft Access MVP
>
>
> "BrianP" wrote:
>
> > I have two columns in tbl.Jobs. One field is a bit data type that I named
> > Jobs.OnHold and the control on the form is a check box. I also have a
> > date/time field named HoldDate. I want the hold date field to automatically
> > udpate with the current date everytime the check box control is udpated. What
> > is the best way to accomplish this?
|
|
0
|
|
|
|
Reply
|
Utf
|
2/16/2008 9:53:00 PM
|
|
When you say field, we need to qualify that. Forms don't have fields, they
have controls. Tables and queries have fields. So, to answer your question,
assuming Sold and Date Of Sale are actually controls on your form, it would
be:
Private Sub Sold_AfterUpdate()
If Me.Sold = True Then
Me.[Date Of Sale] = Date
End If
End Sub
If you posted field named instead of control names, use the names of the
controls the fields are bound to. Note the brackets [] around Date Of Sale.
That is necessary because you used spaces in a name. Names should not have
spaces or any other special characters. They should contain only letters,
numbers, and the underscore character. They should also not be Access
reserved names like Date, Time, Name, Description, Year, Month, Day, etc.
Being careful about your naming will save you a lot of headaches.
--
Dave Hargis, Microsoft Access MVP
"maryb" wrote:
> I have a similar question. I have a field called "Sold" which is a check box.
> When I check it I want the field "Date of Sale" to automatically fill in
> with todays date. I understand going to the "after update event" but I don't
> know what code to write.
> Hope you can help. Thank you
>
> "Klatuu" wrote:
>
> > Use the After Update event of the check box control:
> >
> > Me.txtHoldDate = Date
> >
> > --
> > Dave Hargis, Microsoft Access MVP
> >
> >
> > "BrianP" wrote:
> >
> > > I have two columns in tbl.Jobs. One field is a bit data type that I named
> > > Jobs.OnHold and the control on the form is a check box. I also have a
> > > date/time field named HoldDate. I want the hold date field to automatically
> > > udpate with the current date everytime the check box control is udpated. What
> > > is the best way to accomplish this?
|
|
0
|
|
|
|
Reply
|
Utf
|
2/16/2008 10:01:01 PM
|
|
|
4 Replies
465 Views
(page loaded in 0.117 seconds)
Similiar Articles: Update a date/time control when check box control is updated ...I have two columns in tbl.Jobs. One field is a bit data type that I named Jobs.OnHold and the control on the form is a check box. I also have a date/time field named ... Access 2007 Auto update Date - microsoft.public.accessUpdate a date/time control when check box control is updated ... A Listbox or Combo Box would be a much easier control to manage ... Access 2007 Auto update Date ... Latest VB6 Cumulative Update? - microsoft.public.vb.general ...Update a date/time control when check box control is updated ... Latest VB6 Cumulative Update? - microsoft.public.vb.general ..... use common dialog and common control. Check Box / Bound field - microsoft.public.access.formscoding ...Update a date/time control when check box control is updated ..... instead of control names, use the names of the controls the fields are bound to. ... microsoft.public ... conditional update of checkbox dependent on combo box in separate ...... box and the checkbox in question) update fields in underlying tables once updated ... Update event of the combo box to set the check ... Date format in a combo box ... Date picker and afterupdate event - microsoft.public.access ...... check box control is updated ... with todays date. I ... updating date ... date picker, microsoft access, time data: What is the ControlSource of the date_updated control? Stopping Automatic Message Box - microsoft.public.access ...... dtksocal@discussions.microsoft.com> wrote in message ... stop automatic date updating in word & excel - microsoft ... ... Update a date/time control when check box control ... Can I setup two checkbox so that you can only check one at a time ...... WHERE clause, so only related records are updated. ... ... Insert Date/Time to new field once a checkbox is ... Excel: Excel Check Box, checkbox control, check boxes For example, If ... bound text box - microsoft.public.access.forms... box on a form which is bound to a date ... box updates the value in the table? i type in a new value, but if i check the value in the table it hasn't updated ... box control ... Change field format based on condition - microsoft.public.access ...... field with control source: =IIf([Status]="Closed",[Closed Date],[Last Update ... Closed Date],"Short Date"),Format([Last Update],"Short Time ... Enable a Check Box ... Update a date/time control when check box control is updated ...I have two columns in tbl.Jobs. One field is a bit data type that I named Jobs.OnHold and the control on the form is a check box. I also have a date/time field named ... What is Java Update?... for Updates Automatically check box. To ... and the date and time for the Java Update. Click OK. The Java Update scheduler will check ... of the Update tab on the Java Control ... Control when links are updated - Excel - Office.comThe control of how linked information is updated in Microsoft ... Clear the Ask to update automatic links check box. ... is not updated in the source file.) or any time the source ... Using the calendar control in Access - Access - Office.com... control, such as a check box or ... box is updated with the date you specified. Adding a calendar control to ... date/time field. If you want the calendar control and a text box ... Replacing the Calendar Control in Access 2010 ApplicationsIn the Insert Active Control dialog box, scroll down to find Microsoft Date and Time ... and notice that the check box in the control is ... does all the work of updating ... 7/11/2012 5:36:22 PM
|
|
|
|
|
|
|
|
|