S
Steve Hughes
Hi, I'm trying to refer to fields within a form using a
variable string. I'm trying to create a procedure that
will create an SQL string depending on what option has
been selected in 8 lookup boxs on a form. I don't really
want to use 8 if statements and therefore I am trying to
use For count loop.
I just can't get it to view different fields in the form
at different stages of the loop.
A very simplied version of the code is shown below. It
should just display the contents of each of the 8 boxes.
can anyone please tell me where I'm going wrong?
Dim strAndField as String
Dim inos as Integer
For count = 1 To 8 Step 1
strAndField = "Category" & inos
MsgBox Me![ & StrAndField & ]
Next count
Many Thanks
variable string. I'm trying to create a procedure that
will create an SQL string depending on what option has
been selected in 8 lookup boxs on a form. I don't really
want to use 8 if statements and therefore I am trying to
use For count loop.
I just can't get it to view different fields in the form
at different stages of the loop.
A very simplied version of the code is shown below. It
should just display the contents of each of the 8 boxes.
can anyone please tell me where I'm going wrong?
Dim strAndField as String
Dim inos as Integer
For count = 1 To 8 Step 1
strAndField = "Category" & inos
MsgBox Me![ & StrAndField & ]
Next count
Many Thanks