This is probably a simple syntax question.
How do I use Me. with a variable? (Access 2010)
Thanks in advance for the assistance.
How do I use Me. with a variable? (Access 2010)
Code:
Dim i as integer
Dim myNumber as integer
Dim strSource as string
Dim strDestination as string
For i = 11 To 16
' assign text box names to a strings
strSource = "txtBoxA" & CStr(i)
strDestination = "txtBoxB" & CStr(i)
' convert text box string value to numeric variable
myNumber = val(me.strSource)
' do some math
myNumber = myNumber + 1
' convert and display result
me.(strDestination) = CStr(myNumber)