473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Update date automatically

In my Access form, users update 11 check boxs when their work is completed, when this 11 boxed checked then the 12th check box will check automatically using after update & updatelast event.
Now i have added the 6 the column with date completed, here i want the date to be updated automatically when the 5th column is checked automatically. how to do it?
Breaking my head

Expand|Select|Wrap|Line Numbers
  1. Private Sub Updatelast()
  2. Me.Check110 = Me.Check88 And Me.Check90 And Me.Check92 And Me.Check94 And Me.Check96 And Me.Check98 And Me.Check100 And Me.Check102 And Me.Check104 And Me.Check106 And Me.Check108
  3. End Sub
this is my code. I have used afterupdate in all the checks from 88 to 108, when the user checks all the boxes, Check 110 will update automatically using Update last. Until this its perfectly working. Until the user check all the boxes, check 110 will not get checked.
User can't update check110 manually, its locked
Now i have added another field and when check110 updated automatically, i want the date to display, if the check 110 deselected, the date should be removed. is it possible?

i tried the below code, but not working
but i think the event i have selected is wrong, i dont know what event to use.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Check110_Click()
  2. If (Me!Check110 = "Yes" Or "True" Or "-1") Then
  3. Me!Text125 = Date
  4. Else
  5. Me!Text125 = Null
  6. End If
  7. End Sub
Any help, highly appreciated!!!
Mar 24 '14 #1
3 1247
zmbd
5,501 Expert Mod 4TB
I'll give you a hint here

Try this on a new form
Add just the check box named check2
and just the text box named text0

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private Sub Check2_Click()
  5.     If Me.Check2 Then
  6.         Me.Text0.Value = Date
  7.     Else
  8.         Me.Text0.Value = Null
  9.     End If
  10. End Sub
See the two differences between your code and mine?

Check boxes are typically true/false by default and can be set to triple state true/false/null in the properties.

perhaps the value isn't absolutely needed for the textbox; however, I tend to use it.
Mar 24 '14 #2
Hi,

Thank you for your idea.

But i can't use the onclick event, because check110 not updated by user, based on the other checkboxes it will update automatically.
This is were i got struck.
Mar 25 '14 #3
zmbd
5,501 Expert Mod 4TB
You'll have to see if the onchange event will work as none of the others will trigger when the control is set via VBA until the record changes or the user interacts with the control.
Not sure why you are doing this with this control... seems awfully bashed-togeither.
Mar 25 '14 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Maziar Aflatoun | last post by:
Hi, Does anyone know if it's possible to have a field automatically update itself with the contents of another field in MySQL? I have 2 fields DueDate and DaysOverdue. DueDate is a date field...
5
by: matthew.newsome | last post by:
I have 4 fields on a form, they are simple drop downs, which can be changed throughout the life of a record. I have a date field that users change when they changeone of the four drop downs,...
0
by: Sambhav | last post by:
Hi I am using MS sql right now I m felling up the data into the database using a software called DTM data generator so my problem is I have filled all the dates in 4 different columnsin a single...
1
by: Sambhav | last post by:
Hi I am using MS sql right now I m felling up the data into the database using a software called DTM data generator so my problem is I have filled all the dates in 4 different columnsin a single...
4
by: EOHS | last post by:
I use Access 2002. I created a form that updates when a patient gets a Flu Vaccine. I would like to simply check a checkbox and the form should take todays date and store it in the field FLUDATE...
4
by: MunaAlBaloshi | last post by:
I am working with MS Access. But I want the date and time be automatically updated in the field. I know that I have to use VB codes. I try to write this code but it is not working. Private Sub...
4
by: nominoo | last post by:
Hi all I've developed a query in access that updates the value of a field, in relation to the value of another field i.e Field one contains a date and the query projects a start date 91 days...
9
by: Raza Zahur | last post by:
Hi all, I've googled and googled but I can google no more, so I am here to ask for help on an issue I am having. I have a macro that runs a series of queries. Before the macro can be run, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.