[AccessD] Record Selector Withevents Demo

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Mon Mar 3 17:52:00 CST 2003


John:

I do something similar, ala carte, in my (fabulously) bound forms:

Private Sub cboAgreements_AfterUpdate()

    Me.RecordsetClone.FindFirst "[fldRAHID] = " & cboAgreements.Value
    If Me.RecordsetClone.NoMatch Then
        MsgBox "Agreement Number not found.", vbExclamation
    Else
        Me.Bookmark = Me.RecordsetClone.Bookmark
    End If

    cmdExit.SetFocus
    cboAgreements.Visible = False

End Sub

which displays a rental agreement selected from the combo box.  (Of course
the "Agreement Number not found.",  code should never execute.)

What is the advantage of what you've done vs. this?

Rocky

----- Original Message -----
From: "John W. Colby" <jcolby at colbyconsulting.com>
To: "AccessD" <AccessD at databaseadvisors.com>
Sent: Sunday, March 02, 2003 8:10 AM
Subject: [AccessD] Record Selector Withevents Demo


> 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
>
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>





More information about the AccessD mailing list