Home  |   French  |   About  |   Search  | mvps.org  

What's New
Table Of Contents
Credits
Netiquette
10 Commandments 
Bugs
Tables
Queries
Forms
Reports
Modules
APIs
Strings
Date/Time
General
Downloads
Resources
Search
Feedback
mvps.org

In Memoriam

Terms of Use


VB Petition

Forms: Have the form move to the record selected in List/Combo box

Author(s)
Dev Ashish

(Q) I would be like to be able to have my form automatically go to a particular record when I click a row in a list box or select a particular value in a combo box. How do I do this?

(A) If you have the ID column as the bound column in your listbox/combobox, you can put the following code in the AfterUpate event of the control:

CAUTION:  Make sure you have read about the Bookmark Bug.

'****** Code Start *********
 'Move to the record selected in the control
 Me.RecordsetClone.Findfirst "[ID] = " & Me![ComboOrListboxName]
 Me.Bookmark = Me.RecordSetClone.Bookmark
 '******* Code End *********

© 1998-2010, Dev Ashish & Arvin Meyer, All rights reserved. Optimized for Microsoft Internet Explorer