473,770 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FINISHED date

69 New Member
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 1791
NeoPa
32,573 Recognized Expert Moderator MVP
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
KMEscherich
69 New Member
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_FINISHE D 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 Recognized Expert Specialist
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,573 Recognized Expert Moderator MVP
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
2983
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? For example the visitor clicks on a file download link, and when his download is finished then i want to happen something (for example some download counter or something like that.)
1
21311
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 WebBrowser.ReadyState = STATE_COMPLETE (or something like that. I don't have the code in front of me) But, for some reason, occasionally the code continues past the loops even
3
2043
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 undeclared - assuming an external is returning integer values." This is not the source of the problem. Step-Thru causes the system to demand the location of system-sounding files like: CHKSTK.ASM, CRT0.C, READ.C. With no real debugger...
6
1676
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? http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=89ed5u%248ck%40library1.airnews.net (Incase the URL doesn't make it I've copied it below.) I have a situation where I really need this technique. But the fact that Dave Abrahams wasn't sure about it very much worries...
0
2847
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 date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. The Refresh method forces the WebBrowser...
8
2643
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
7837
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: myPlayer.Play() and myPlayer.Stop() methods which works great, but i want to know when the sound actually stops playing (so I can change my button's picture). If I raise a custom event after the myPlayer.Play()
13
10724
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 process the file. The appearance of the command file triggers the device to grab the original file. My problem is I don't want to write the command file to the device until the original file from the workflow has been copied completely. Since these...
0
2602
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 code I used as a starting point. Second, I hope this code helps someone as much as they helped me. I have built a Nullable DateTimePicker and NullableCalendarColumn/Cell/EditingControl that is nearly 100% complete, as far as I can tell. There is...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10259
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.