I have about 10 text fields in a form that are actually used to display without writing. They are called txt_001_Name , txt_002_Title , etc. What type of loop is used for this.
Which VBA should be used to actually scroll through the text field names? Therefore, if I were debug.print, it would look like this:
txt_001_Title txt_002_Title txt_003_Title
This is probably pretty simple - especially since I have to learn!
EDIT: Sorry, I should have described it in more detail.
Due to the above naming convention, I am looking for iteration through these text fields so that I can do something with each. What each of these 10 text fields represents is numeric values, each of which has an SQL statement behind it in the form of onload . I also have another set of ten that contain numerical values โโthat are much more static, and finally ten more that use an expression to simply divide each of the first ten against the relative โsecondโ ten, and the value ends in relative 3. So basically it looks like a dashboard table.
'first ten' 'second ten' 'resulting ten' --------------------------------------------------- txt_001_value txt_001_calc txt_001_result txt_002_value txt_002_calc txt_002_result
and etc.
So I really want to use this for the "result" text fields. I want to go through the top ten and do this simple calculation:
me.txt_001_result = me.txt_001_value / me.txt_001_calc
All naming conventions โmatchโ, so I can manually print 10 lines above for this, but I'm sure there is a better way (going around this loop), and I should probably study it.
loops vba access-vba ms-access
Justin
source share