Discussion Locked

MS Access 97 (AutoTab Feature)

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a DB that has a stand alone form that will print to a report, only when the form is open using unbound fields. Problem is if the user(s) do not tab out of the last field, it will not print and this field is used more than once. My question is how can I add to the macro I have ON Print that I need it to tab to the next field or out of their last field before printing. Like I said I worls great as long as they tab out of the last field they enter data to, but if they forget, it will notprint only the last field or the field they are in. So basically I only need a macro (or something) to do a single tab and I can add that to my already existing macro that prints everything.

Thank you.

5 replies

by roc180

Use the setFocus property of a control to move the focus from your last field to a more desirable location. Or if you really want to send a TAB key press, use the SendKeys function. Example:

Private Sub CmdPrint_Click()
TxtField1.SetFocus 'Moves Focus(just like TAB)
Call MyMacro
End Sub

Good Luck

Neal Martinelli

by donq

Late again - Roc180's answer is what you need, you might add his suggested SetFocus line to the click event of the control that runs the report just before anything else happens.

This discussion is closed to new replies.