Add a Command Button to the form, and look at the properties of the button
you just added. (if you've got the wizard icon depressed, so that the
Command Button Wizard starts when you add the button, simply click on the
Cancel button to get out of the wizard)
You'll see a list of Events associated with the control (in fact, there's a
tab in the Properties window that will let you limit what you're seeing to
only the events.
Find the event labelled On Click. The white box to the right of that is
actually a combo box: select [Event Procedure] from it, then click on the
ellipsis (...) to the right. You'll get taken into the VB Editor, with
something like the following added for you:
Private Sub Command1_Click()
End Sub
Simply type those 3 lines of code I showed between those two lines of text,
so you end up with something like:
Private Sub Command1_Click()
If Screen.PreviousControl.ControlType = acTextBox Then
Screen.PreviousControl = Date - 1
End If
End Sub
That's it. You're done. Save the form, and test that it does what you want.
In terms of an AutoKeys macro, make sure you have the Macro Name column
visible. Put whatever key combination you want to use as your shortcut in
the Macro Name column (say ^y for yesterday and ^t for tomorrow), and select
SetValue as the Action. In the dialog at the bottom, put
[Screen].[ActiveControl] as the Item, and Date() - 1 or Date() + 1 as the
expression. Name the macro AutoKeys when you save it, and you're done.