| DatabaseLessons.com |
'Serving the Microsoft® Access |
|
|
Referring to Fields and Form ObjectsIn my article on
Looping Through Fields In Unbound Forms I used VBA constructs
like this in my form: (article continues after sponsor spot) First, several ways to refer to fields from records in a recordset
Next, several ways to refer to objects on a form (or report)
What I love about the final choice in each case is the ability to create the variable's contents "on-the-fly". I created a form that had a 15 by 15 grid of text boxes. The names were like this example, a0712, which was the name of the textbox in the 7th column, 12th row. You could easily write some code that would determine the value of the row and column and then do something like this ...
That final VBA statement starting with "Me" will determine the
name of the textbox "on-the-fly", such that the VBA interpreter sees NOTE: All the VBA code segments on the Database Lessons site assume that you have DAO references active. If you are not sure what this means, and you are using Microsoft Access 2000 or higher, click here. Happy Coding |
|
|
© 2006, 2007, 2008 Richard W. Killey. All Rights Reserved. - Privacy Policy |