Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding the autonumber field when blank 1

Status
Not open for further replies.

perrymans

IS-IT--Management
Nov 27, 2001
1,340
US
I have a autonumber field as the Primary key. On a new record, the user sees (Autonumber). Once the first item is entered and the record is created, it is given an autonumber. How can I hide this autonumber txtBox until it has a value/ the record has been started?

I tried checking for a null value in the Autonumber txtBox using the Form_OnCurrent property, but this only fires after leaving the record.

I realize I could set this using the After Update of say the first control on the form, but this won't take into account that someone may skip to another control first.

Thanks. Sean.
 
use the beforeinsert and afterinsert properties on your form
 
You could set the a control to have focus when a clean form is displayed, then call the onExit event on the field that you gave focus.
 
Thanks guys. Neither really does what I had hoped for. I am going with the on_exit of the first control, and will just set it up so the user can't leave that control with selecting something (it's a combo box).

The beforeinsert/ afterinsert doesn't fire when the record is created, which is what I was looking for.

Thanks again. Sean.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top