Tab back to first field in subform

flavioso

Registered User.
Local time
Today, 10:27
Joined
Jan 21, 2008
Messages
16
Hello, Would anyone know how to tab back to the first field in a subform using VBA? I would like to prevent a user from adding more than one record in a subform, yet I want them to be able to add a new record when the record doesn't exist, and at the same time be able to update information when needed, but do not want the subform to tab to a new record.

Any suggestions?

Thanks, in advance

Bradley
 
In the On Lost Focus event of the last tab stop on the subform you could use;

Code:
Me.NameFirstTabStop.SetFocus
 
hm. it sounds strange that you want only one record in a subform - this could indicate incorrect design. are you limiting to one record EVER, or just per user? (and why?)
 
I got around this by changing the 'Cycle' property on the 'Form' Properties to 'Current Record' instead of 'All Records'

This way, when the last tab is reached, it just cycles back through the same record instead of going to a new one.
 

Users who are viewing this thread

Back
Top Bottom