John W. Colby
jcolby at colbyconsulting.com
Sun Mar 2 10:10:00 CST 2003
I have added another withevents demo class to my site that is actually useful if you like the technique. This class creates a combo box that is used as a record selector for finding records in bound forms. The class is initialized passing in the form, the record selector combo and a text box bound to the autonumber PK field. When the user selects a record in the combo, the AfterUpdate event handler in the class is activated. It finds the record in the form and sets the form's bookmark to that record so that the form "moves to" that record. The class exposes a public method that the form's current event calls that keeps the record selector combo pointing to the same record that the form is on if the user moves through the records manually by page down etc. This class is fully functional, and can be used in your projects simply by importing the class, cutting and pasting the combo and text box onto your form, binding the text box to the PK field for that form, and setting the combo's SQL to the recID and one or more fields that allow the user to choose a record. Cut and paste the code in the demo form and you are up and running with a record selector on any bound form. The demo is fully functional and demonstrates this technique. John W. Colby Colby Consulting www.ColbyConsulting.com I've stopped 9,208 spam messages. You can too! Get your free, safe spam protection at http://www.cloudmark.com/spamnetsig/ ---------------------------------------------------- Is email taking over your day? Manage your time with eMailBoss. Try it free! http://www.eMailBoss.com