473,387 Members | 1,548 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,387 software developers and data experts.

FINISHED date

Using Access '97

I have a sub-form on a main form that allows for 5 line items to be made against each PRIMARY KEY. On this sub-form, I have a FINISHED checkbox that the end-user is to select when finishing a row of data against the PRIMARY KEY. Once the end-user selects the FINISHED checkbox, the row of data locks and no one can make any changes.

Am wondering if there is a way to capture a SYSDATE each time someone selects the FINISHED checkbox and record that date in a table so I can report against the FINISHED dates at a later date.

If you use DATE() then the date will fluctuate each time there is an entry. I need to be sure the FINISHED DATE be locked in so there will be no changes to the FINISHED DATE.

Can someone please help me with this??

Thank you.
Jul 2 '07 #1
4 1773
NeoPa
32,556 Expert Mod 16PB
It's hard to answer that without any idea of your data structure, but as a general idea, set a field in your table to the current value of Date() when the CheckBox is checked. You would need to put code in an AfterUpdate event procedure for it. If it's possible to UNcheck it, you need to handle that as well.
Jul 2 '07 #2
It's hard to answer that without any idea of your data structure, but as a general idea, set a field in your table to the current value of Date() when the CheckBox is checked. You would need to put code in an AfterUpdate event procedure for it. If it's possible to UNcheck it, you need to handle that as well.

Thank you for getting back to me. I tried this and it seems to not pull in a date.

Expand|Select|Wrap|Line Numbers
  1. Private Sub FINISHED_AfterUpdate()
  2.     If Me.FINISHED Is NotNull Then Me.DATE_FINISHED = CurrentDate
  3.     End If
  4. End Sub


ME.FINISHED = Checkbox
ME.DATE_FINISHED is where I want to see a date.

I created a field in the table also.

Can you show me how to correct this code??

Thank you.
Jul 2 '07 #3
missinglinq
3,532 Expert 2GB
Not to be unkind, but if you want to use Visual Basic for Applications, you need to study the language before you start writing. Syntax from other programming languages, often including straight Visusal Basic, cannot be used! Is NotNull is not valid in VBA, you have to use Not IsNull. Neither is CurrentDate. In VBA you would use Date() for just the date, or Now() if you want the date and time.

The following code will accomplish your goal! It will set Date_Finished to the current date when Finished is checked, and clear it if Finished should be unchecked.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Finished_Click()
  2. If Me.Finished Then
  3.   Me.Date_Finished = Date
  4. Else
  5.  Me.Date_Finished = ""
  6. End If
  7. End Sub
If you copy and paste this code and the line numbers and periods appear in your code, be sure to delete them!

Good Luck!

Linq
Jul 3 '07 #4
NeoPa
32,556 Expert Mod 16PB
Linq's code should work fine for you, but I'd do it slightly differently. You choose :)
Expand|Select|Wrap|Line Numbers
  1. Private Sub FINISHED_AfterUpdate()
  2.     Me.DATE_FINISHED = IIf(Me.FINISHED, Date(), "")
  3. End Sub
Jul 3 '07 #5

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

Similar topics

4
by: Bernhard | last post by:
I am not sure if php can achieve this, but i guess that my problem shoulb be solved with an server side language. Is there any way i can tell if a visitor of my website has finished a download?...
1
by: BKM | last post by:
I've been using the following 2 ways to make sure my WebBrowser is finished loading a page before continuing with the next code. do:doevents:loop while WebBrowser.Busy do:doevents:loop until...
3
by: Blankdraw | last post by:
I'm getting NO errors and 2 warnings with this code. I thought I was ready to write the output-formatting segment, but may be way off the mark now. The warnings say that "OPEN() and READ() are...
6
by: Chris Newcombe | last post by:
Please could someone on the VC++ 7.0 compiler team (note; not 7.1) tell me if this code is handled 'correctly' (i.e. as the original poster suggests) in all cases? ...
0
by: cweeks | last post by:
>From the MSDN documentation for WebBroswer.Refresh(): "The WebBrowser control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration...
8
by: Diego F. | last post by:
Hello. I'd like to know if there's a way to know if all threads started using the threadpool are finished. How can I ensure that all threads finished? -- Regards, Diego F.
3
by: Jack | last post by:
Hi, I'm writing a simple wav player (like winamp) and using the SoundPlayer class in c# 2005. Using winform buttons, I can begin playing the sound and stop half-way through the sound using:...
13
by: writeson | last post by:
Hi all, I'm writing some code that monitors a directory for the appearance of files from a workflow. When those files appear I write a command file to a device that tells the device how to...
0
by: tschroeder250 | last post by:
Hi Everyone, There are so many Nullable DateTimePickers out there that this post may not even be found among all the others, but I wanted to try. First, I want to thank all the authors of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.