PC Review


Reply
Thread Tools Rate Thread

automatic date & time for button-click

 
 
Kyle
Guest
Posts: n/a
 
      30th Jan 2006
I have a form I use for updating information for records in my
database. On the form I have a button that executes a VB object
printing out the report for that record only, using Tom Wickerath's
instructions posted on May 23, 2004.

What I'd like to add is the ability to have the date field in the form
automatically update to the current date when the button is clicked on,
but only then. I don't want the form to update the date just from
viewing the record. Since there's already [Event Procedure] in the "On
Click" under the button's Properties, what can I do to add this
capability?

Thanks!

 
Reply With Quote
 
 
 
 
Rick B
Guest
Posts: n/a
 
      30th Jan 2006
Just add a line to change your "timestamp" field to the values you want.
Not sure what the field's name is, so I will use "timestamp"...


Timestamp = Now()


--
Rick B



"Kyle" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have a form I use for updating information for records in my
> database. On the form I have a button that executes a VB object
> printing out the report for that record only, using Tom Wickerath's
> instructions posted on May 23, 2004.
>
> What I'd like to add is the ability to have the date field in the form
> automatically update to the current date when the button is clicked on,
> but only then. I don't want the form to update the date just from
> viewing the record. Since there's already [Event Procedure] in the "On
> Click" under the button's Properties, what can I do to add this
> capability?
>
> Thanks!
>



 
Reply With Quote
 
Kyle
Guest
Posts: n/a
 
      30th Jan 2006
So I tried a few ideas, including yours, Rick, and came up with a
rather elegant solution considering my almost complete lack of Visual
Basic knowledge.

In the Sub that I copied from someone else to print out the single
record's report, I stuck the following line after the line for the
print command:
[EntryDate] = Date()
where "EntryDate" is the name of my date field. Now the date updates
after I click on the Print button on the form.

Schweet!

 
Reply With Quote
 
Kyle
Guest
Posts: n/a
 
      30th Jan 2006
Oh, by the way, Rick, now that I've re-read your post, I finally
figured out that you were saying to put your line in my VB for the
button's procedure. Kyle says "D'oh!"

I did have to change it because we only track date, not date and time,
which Now() creates date and time and Date() was what I needed.

 
Reply With Quote
 
Rick B
Guest
Posts: n/a
 
      30th Jan 2006
Great! That seems like an even better place to put it since that only fires
if the report actually loads property. Doing it in the "on click" for the
button might make the entry prematurely.

--
Rick B



"Kyle" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> So I tried a few ideas, including yours, Rick, and came up with a
> rather elegant solution considering my almost complete lack of Visual
> Basic knowledge.
>
> In the Sub that I copied from someone else to print out the single
> record's report, I stuck the following line after the line for the
> print command:
> [EntryDate] = Date()
> where "EntryDate" is the name of my date field. Now the date updates
> after I click on the Print button on the form.
>
> Schweet!
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
click date/time field display calendar and validation of date /tim Smithskenpo Microsoft Outlook Form Programming 0 4th Mar 2010 08:20 PM
Date and time entry on button click =?Utf-8?B?YmVhcnNmYW4=?= Microsoft Excel Programming 3 19th Oct 2006 09:12 PM
date/time automatic update is off but date still updates. =?Utf-8?B?am9jYXNhbQ==?= Microsoft Word Document Management 2 11th Feb 2006 03:50 PM
how can i automatic run slide show without click the next button =?Utf-8?B?c2VsZXdl?= Microsoft Powerpoint 1 11th Jun 2005 10:53 AM
Date() Automatic insert at mouse click =?Utf-8?B?U3RldmU=?= Microsoft Access 3 5th Mar 2004 12:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:02 PM.