Print Date and Time on button press (1 Viewer)

JohnPapa

Registered User.
Local time
Today, 21:40
Joined
Aug 15, 2010
Messages
954
Got a strange request. When a user presses a button the Date and Time of the press is printed. Might I hook up the button to an rs232 port or usb port.

The pressing of the button sends an electrical signal (not a series of chars)

Any idea how to go about it?
 

JohnPapa

Registered User.
Local time
Today, 21:40
Joined
Aug 15, 2010
Messages
954
Thanks for your reply. I believe for a printer in general. They need some kind of logging system, when someone enters a premise. They are being a bit secretive.

If I can capture the button press in a log file (which can later be printed somewhere) then we are done.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 19:40
Joined
Jul 9, 2003
Messages
16,272
Create a table with a single field named "fldDateTime" and set its datatype to Date/Time

Create a form based on this Table. Place on the form a Command button and a textbox.

Name the Text box "txtRecordNow"

Link the Textbox to the field in the table "fldDateTime"

Enter in the on Click event for the command button the following code:-

Code:
'
'
'
DoCmd.GoToRecord , , acNewRec
    Me.txtRecordNow = Now()
'
'
'
 
Last edited:

JohnPapa

Registered User.
Local time
Today, 21:40
Joined
Aug 15, 2010
Messages
954
Apologies. When I said "press a button" I meant "press a physical button" not a form button.

Summarizing, someone enters a premise, presses a physical button (connected to a pc) and upon pressing the button a ticket is printed on a printer connected to the pc with the date and time.

Can someone suggest how to capture/interface the physical press of the button? Maybe with an rs232 connection or usb connection?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 19:40
Joined
Jul 9, 2003
Messages
16,272
It's possible but is it desirable?

You would need to have a PC running constantly, just for this task.

Where as the Internet of things offers many ways of creating a simple logger, connected to a log table in the Cloud for probably less than $100... (I haven't looked)





Sent from my SM-G925F using Tapatalk
 

JohnPapa

Registered User.
Local time
Today, 21:40
Joined
Aug 15, 2010
Messages
954
This is a requirement from the customer. We understand that there is a need to have a pc on at all times.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 19:40
Joined
Jul 9, 2003
Messages
16,272
Coming at it from a different angle I thought well maybe some one has done this before.

So I did a Google search on >>> USB VBA "push button" <<<

And there's quite a lot of ideas out there and some videos on particular proprietary Solutions, I suggest you have a look yourself.

In particular this one looked promising:-

http://www.usbbutton.com

The webpage is a bit busy and didn't render that well on my mobile so you'll probably better off having a look at it on a PC...

Sent from my SM-G925F using Tapatalk
 
Last edited:

Users who are viewing this thread

Top Bottom