Ja***@agiftforteaching.org wrote in news:1162414012.599181.160730
@i42g2000cwa.googlegroups.com:
Hello,
I am having a problem with a MS Access 2000 Database that I
partially helped create. I am recording visits that registered
customers make to our store. I have a list of all the elidgible people
that can shop, and when I click a button, it records a visit for today
in Date/Time format.
My problem is that the button that records the visit can be
clicked multiple times, and I am trying to find a way to lock it for a
few seconds so that itchy double-clickers can't record more than one
visit every 5 seconds. Basically, I am looking for code in VB that
"upon click, disable such&such button for 5 seconds."
If anyone can help, it would be greatly appreciated.
Thanks-
I would be inclined to modify the date before storing it and to create a
unique index on the person and that modified date.
A function to return just the date and hour might be:
Public Function DatetoNearestHour(ByVal vdate As Date) As Date
DatetoNearestHour = DateSerial( _
Year(vdate), _
Month(vdate), _
Day(vdate)) _
+ _
TimeSerial(Hour(vdate), 0, 0)
End Function
or
Public Function DatetoNearestHourB(ByVal vdate As Date) As Date
DatetoNearestHourB = CDate(Fix(24 * CDbl(vdate)) / 24)
End Function
Buttons are bad; they are a carry-over from dos; buttons with peculiar
code are badder.
--
Lyle Fairfield
from
http://msdn.microsoft.com/library/de...l=/library/en-
us/dnmdac/html/data_mdacroadmap.asp
Obsolete Data Access Technologies
Obsolete technologies are technologies that have not been enhanced or
updated in several product releases and that will be excluded from future
product releases. Do not use these technologies when you write new
applications. When you modify existing applications that are written
using these technologies, consider migrating those applications to
ADO.NET.
The following components are considered obsolete:
....
Data Access Objects (DAO): DAO provides access to JET (Access) databases.
This API can be used from Microsoft Visual Basic®, Microsoft Visual C++®,
and scripting languages. It was included with Microsoft Office 2000 and
Office XP. DAO 3.6 is the final version of this technology. It will not
be available on the 64-bit Windows operating system.
.....