MikeLiberty
Board Regular
- Joined
- Aug 13, 2010
- Messages
- 55
Hi,
I know a little VBA from my work with Excel, but I'm having trouble moving over into Access. I'm trying to find a way to determine if the value of a variable exists within a table. How do I compare a variable to all of the rows in a field. If I was in excel, I'd just loop through with for each or something similar but I'm not sure what the syntax is for doing it in Access.
Can anyone help me? I'm envisioning something like this.
For each ? in table.field
if ? = myvariable then
execute code
end if
Next ?
Thanks,
mike
I know a little VBA from my work with Excel, but I'm having trouble moving over into Access. I'm trying to find a way to determine if the value of a variable exists within a table. How do I compare a variable to all of the rows in a field. If I was in excel, I'd just loop through with for each or something similar but I'm not sure what the syntax is for doing it in Access.
Can anyone help me? I'm envisioning something like this.
For each ? in table.field
if ? = myvariable then
execute code
end if
Next ?
Thanks,
mike